diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2013-02-21 19:44:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-21 20:22:27 -0500 |
commit | c8a6046e1e0bb03406e4fc6c0a204ef58a1868e4 (patch) | |
tree | c041260ad34e5b5924c6bc5b09e9042e6df77574 /drivers/rtc/rtc-twl.c | |
parent | f32bc70d5f938cfef3e534c9db6d38a3759eac6d (diff) |
drivers/rtc: use of_match_ptr() macro
This eliminates having an #ifdef returning NULL for the case when OF is
disabled. Maintains consistency in cases where OF is always selected.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-twl.c')
-rw-r--r-- | drivers/rtc/rtc-twl.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c index ccd4ad370b32..8bc6c80b184c 100644 --- a/drivers/rtc/rtc-twl.c +++ b/drivers/rtc/rtc-twl.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/bcd.h> | 27 | #include <linux/bcd.h> |
28 | #include <linux/platform_device.h> | 28 | #include <linux/platform_device.h> |
29 | #include <linux/interrupt.h> | 29 | #include <linux/interrupt.h> |
30 | #include <linux/of.h> | ||
30 | 31 | ||
31 | #include <linux/i2c/twl.h> | 32 | #include <linux/i2c/twl.h> |
32 | 33 | ||
@@ -588,11 +589,14 @@ static int twl_rtc_resume(struct platform_device *pdev) | |||
588 | #define twl_rtc_resume NULL | 589 | #define twl_rtc_resume NULL |
589 | #endif | 590 | #endif |
590 | 591 | ||
592 | #ifdef CONFIG_OF | ||
591 | static const struct of_device_id twl_rtc_of_match[] = { | 593 | static const struct of_device_id twl_rtc_of_match[] = { |
592 | {.compatible = "ti,twl4030-rtc", }, | 594 | {.compatible = "ti,twl4030-rtc", }, |
593 | { }, | 595 | { }, |
594 | }; | 596 | }; |
595 | MODULE_DEVICE_TABLE(of, twl_rtc_of_match); | 597 | MODULE_DEVICE_TABLE(of, twl_rtc_of_match); |
598 | #endif | ||
599 | |||
596 | MODULE_ALIAS("platform:twl_rtc"); | 600 | MODULE_ALIAS("platform:twl_rtc"); |
597 | 601 | ||
598 | static struct platform_driver twl4030rtc_driver = { | 602 | static struct platform_driver twl4030rtc_driver = { |
@@ -604,7 +608,7 @@ static struct platform_driver twl4030rtc_driver = { | |||
604 | .driver = { | 608 | .driver = { |
605 | .owner = THIS_MODULE, | 609 | .owner = THIS_MODULE, |
606 | .name = "twl_rtc", | 610 | .name = "twl_rtc", |
607 | .of_match_table = twl_rtc_of_match, | 611 | .of_match_table = of_match_ptr(twl_rtc_of_match), |
608 | }, | 612 | }, |
609 | }; | 613 | }; |
610 | 614 | ||