summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-ds1742.c
diff options
context:
space:
mode:
authorAlexander Shiyan <shc_work@mail.ru>2014-01-24 00:55:06 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-24 01:36:59 +0100
commit663b35241df1d0ed24be3d17733807cc8723cc4a (patch)
tree48980b3f8355edabe1a86aab845e016eb0b3da01 /drivers/rtc/rtc-ds1742.c
parentdrivers/rtc/rtc-mxc.c: check the return value from clk_prepare_enable() (diff)
downloadlinux-663b35241df1d0ed24be3d17733807cc8723cc4a.tar.xz
linux-663b35241df1d0ed24be3d17733807cc8723cc4a.zip
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 '')
-rw-r--r--drivers/rtc/rtc-ds1742.c10
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 @@
*/
#include <linux/bcd.h>
-#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/gfp.h>
#include <linux/delay.h>
#include <linux/jiffies.h>
#include <linux/rtc.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/module.h>
@@ -215,12 +216,19 @@ static int ds1742_rtc_remove(struct platform_device *pdev)
return 0;
}
+static struct of_device_id __maybe_unused ds1742_rtc_of_match[] = {
+ { .compatible = "maxim,ds1742", },
+ { }
+};
+MODULE_DEVICE_TABLE(of, ds1742_rtc_of_match);
+
static struct platform_driver ds1742_rtc_driver = {
.probe = ds1742_rtc_probe,
.remove = ds1742_rtc_remove,
.driver = {
.name = "rtc-ds1742",
.owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(ds1742_rtc_of_match),
},
};