From 663b35241df1d0ed24be3d17733807cc8723cc4a Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Thu, 23 Jan 2014 15:55:06 -0800 Subject: drivers/rtc/rtc-ds1742.c: add devicetree support This patch allows the driver to be enabled with devicetree. Signed-off-by: Alexander Shiyan Acked-by: Mark Rutland Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/rtc/rtc-ds1742.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'drivers') 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 -#include #include #include #include #include #include +#include +#include #include #include #include @@ -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), }, }; -- cgit v1.2.3