--- zzzz-none-000/linux-3.10.107/drivers/watchdog/jz4740_wdt.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/watchdog/jz4740_wdt.c 2021-02-04 17:41:59.000000000 +0000 @@ -17,15 +17,14 @@ #include #include #include -#include #include -#include #include #include #include #include #include #include +#include #include @@ -144,6 +143,14 @@ .set_timeout = jz4740_wdt_set_timeout, }; +#ifdef CONFIG_OF +static const struct of_device_id jz4740_wdt_of_matches[] = { + { .compatible = "ingenic,jz4740-watchdog", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, jz4740_wdt_of_matches) +#endif + static int jz4740_wdt_probe(struct platform_device *pdev) { struct jz4740_wdt_drvdata *drvdata; @@ -167,6 +174,7 @@ jz4740_wdt->timeout = heartbeat; jz4740_wdt->min_timeout = 1; jz4740_wdt->max_timeout = MAX_HEARTBEAT; + jz4740_wdt->parent = &pdev->dev; watchdog_set_nowayout(jz4740_wdt, nowayout); watchdog_set_drvdata(jz4740_wdt, drvdata); @@ -177,7 +185,7 @@ goto err_out; } - drvdata->rtc_clk = clk_get(NULL, "rtc"); + drvdata->rtc_clk = clk_get(&pdev->dev, "rtc"); if (IS_ERR(drvdata->rtc_clk)) { dev_err(&pdev->dev, "cannot find RTC clock\n"); ret = PTR_ERR(drvdata->rtc_clk); @@ -213,7 +221,7 @@ .remove = jz4740_wdt_remove, .driver = { .name = "jz4740-wdt", - .owner = THIS_MODULE, + .of_match_table = of_match_ptr(jz4740_wdt_of_matches), }, }; @@ -222,5 +230,4 @@ MODULE_AUTHOR("Paul Cercueil "); MODULE_DESCRIPTION("jz4740 Watchdog Driver"); MODULE_LICENSE("GPL"); -MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); MODULE_ALIAS("platform:jz4740-wdt");