diff options
author | Alexander Shiyan <shc_work@mail.ru> | 2014-01-23 18:55:06 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-23 19:36:59 -0500 |
commit | 663b35241df1d0ed24be3d17733807cc8723cc4a (patch) | |
tree | 48980b3f8355edabe1a86aab845e016eb0b3da01 /drivers/rtc | |
parent | 1b3d2243d049e062d0dc53b85f0e95db67e114af (diff) |
drivers/rtc/rtc-ds1742.c: add devicetree support
This patch allows the driver to be enabled with devicetree.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-ds1742.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-ds1742.c b/drivers/rtc/rtc-ds1742.c index 17b73fdc3b6e..d7f74f5e9090 100644 --- a/drivers/rtc/rtc-ds1742.c +++ b/drivers/rtc/rtc-ds1742.c | |||
@@ -13,12 +13,13 @@ | |||
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <linux/bcd.h> | 15 | #include <linux/bcd.h> |
16 | #include <linux/init.h> | ||
17 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
18 | #include <linux/gfp.h> | 17 | #include <linux/gfp.h> |
19 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
20 | #include <linux/jiffies.h> | 19 | #include <linux/jiffies.h> |
21 | #include <linux/rtc.h> | 20 | #include <linux/rtc.h> |
21 | #include <linux/of.h> | ||
22 | #include <linux/of_device.h> | ||
22 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
23 | #include <linux/io.h> | 24 | #include <linux/io.h> |
24 | #include <linux/module.h> | 25 | #include <linux/module.h> |
@@ -215,12 +216,19 @@ static int ds1742_rtc_remove(struct platform_device *pdev) | |||
215 | return 0; | 216 | return 0; |
216 | } | 217 | } |
217 | 218 | ||
219 | static struct of_device_id __maybe_unused ds1742_rtc_of_match[] = { | ||
220 | { .compatible = "maxim,ds1742", }, | ||
221 | { } | ||
222 | }; | ||
223 | MODULE_DEVICE_TABLE(of, ds1742_rtc_of_match); | ||
224 | |||
218 | static struct platform_driver ds1742_rtc_driver = { | 225 | static struct platform_driver ds1742_rtc_driver = { |
219 | .probe = ds1742_rtc_probe, | 226 | .probe = ds1742_rtc_probe, |
220 | .remove = ds1742_rtc_remove, | 227 | .remove = ds1742_rtc_remove, |
221 | .driver = { | 228 | .driver = { |
222 | .name = "rtc-ds1742", | 229 | .name = "rtc-ds1742", |
223 | .owner = THIS_MODULE, | 230 | .owner = THIS_MODULE, |
231 | .of_match_table = of_match_ptr(ds1742_rtc_of_match), | ||
224 | }, | 232 | }, |
225 | }; | 233 | }; |
226 | 234 | ||