- get regs from device tree Signed-off-by: Nikita Shubin <nikita.shubin@xxxxxxxxxxx> --- Notes: v0 -> v1: - dropped CONFIG_OF, of_match_ptr - dropped coma in id table - changed compatible from "dallas,rtc-m48t86" to "st,m48t86" drivers/rtc/rtc-m48t86.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/rtc/rtc-m48t86.c b/drivers/rtc/rtc-m48t86.c index 481c9525b1dd..b114796d4326 100644 --- a/drivers/rtc/rtc-m48t86.c +++ b/drivers/rtc/rtc-m48t86.c @@ -15,6 +15,7 @@ #include <linux/platform_device.h> #include <linux/bcd.h> #include <linux/io.h> +#include <linux/of.h> #define M48T86_SEC 0x00 #define M48T86_SECALRM 0x01 @@ -269,9 +270,16 @@ static int m48t86_rtc_probe(struct platform_device *pdev) return 0; } +static const struct of_device_id m48t86_rtc_of_ids[] = { + { .compatible = "st,m48t86" }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, m48t86_rtc_of_ids); + static struct platform_driver m48t86_rtc_platform_driver = { .driver = { .name = "rtc-m48t86", + .of_match_table = m48t86_rtc_of_ids, }, .probe = m48t86_rtc_probe, }; -- 2.37.4