leds: tca6507: Use of_match_ptr() macro
authorSachin Kamat <sachin.kamat@linaro.org>
Thu, 14 Mar 2013 10:09:49 +0000 (03:09 -0700)
committerBryan Wu <cooloney@gmail.com>
Mon, 1 Apr 2013 18:04:50 +0000 (11:04 -0700)
This eliminates having an #ifdef returning NULL for the case
when OF is disabled.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
drivers/leds/leds-tca6507.c

index 070ba0741b2168f9f325aff110b8f935f94ac1b6..98fe021ba276f9db64fccc23cca6896245c15e1f 100644 (file)
@@ -85,6 +85,7 @@
 #include <linux/gpio.h>
 #include <linux/workqueue.h>
 #include <linux/leds-tca6507.h>
+#include <linux/of.h>
 
 /* LED select registers determine the source that drives LED outputs */
 #define TCA6507_LS_LED_OFF     0x0     /* Output HI-Z (off) */
@@ -724,7 +725,6 @@ tca6507_led_dt_init(struct i2c_client *client)
        return ERR_PTR(-ENODEV);
 }
 
-#define of_tca6507_leds_match NULL
 #endif
 
 static int tca6507_probe(struct i2c_client *client,
@@ -813,7 +813,7 @@ static struct i2c_driver tca6507_driver = {
        .driver   = {
                .name    = "leds-tca6507",
                .owner   = THIS_MODULE,
-               .of_match_table = of_tca6507_leds_match,
+               .of_match_table = of_match_ptr(of_tca6507_leds_match),
        },
        .probe    = tca6507_probe,
        .remove   = tca6507_remove,