From: Nick Bowler Date: Mon, 30 Jul 2012 21:41:59 +0000 (-0700) Subject: drivers/rtc/rtc-pcf8563.c: add device tree support X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8dccaf0607b3e047680952d0baf4da0486fbbcc1;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git drivers/rtc/rtc-pcf8563.c: add device tree support Set the of_match_table for this driver so that devices can be described in the device tree. Signed-off-by: Nick Bowler Cc: Alessandro Zummo Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/rtc/rtc-pcf8563.c b/drivers/rtc/rtc-pcf8563.c index 24a9d6a9c72d..c2fe426a6ef2 100644 --- a/drivers/rtc/rtc-pcf8563.c +++ b/drivers/rtc/rtc-pcf8563.c @@ -19,6 +19,7 @@ #include #include #include +#include #define DRV_VERSION "0.4.3" @@ -285,10 +286,19 @@ static const struct i2c_device_id pcf8563_id[] = { }; MODULE_DEVICE_TABLE(i2c, pcf8563_id); +#ifdef CONFIG_OF +static const struct of_device_id pcf8563_of_match[] __devinitconst = { + { .compatible = "nxp,pcf8563" }, + {} +}; +MODULE_DEVICE_TABLE(of, pcf8563_of_match); +#endif + static struct i2c_driver pcf8563_driver = { .driver = { .name = "rtc-pcf8563", .owner = THIS_MODULE, + .of_match_table = of_match_ptr(pcf8563_of_match), }, .probe = pcf8563_probe, .remove = pcf8563_remove,