--- zzzz-none-000/linux-3.10.107/drivers/watchdog/pnx4008_wdt.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/watchdog/pnx4008_wdt.c 2021-02-04 17:41:59.000000000 +0000 @@ -23,9 +23,7 @@ #include #include #include -#include #include -#include #include #include #include @@ -82,7 +80,7 @@ static DEFINE_SPINLOCK(io_lock); static void __iomem *wdt_base; -struct clk *wdt_clk; +static struct clk *wdt_clk; static int pnx4008_wdt_start(struct watchdog_device *wdd) { @@ -159,16 +157,17 @@ if (IS_ERR(wdt_base)) return PTR_ERR(wdt_base); - wdt_clk = clk_get(&pdev->dev, NULL); + wdt_clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(wdt_clk)) return PTR_ERR(wdt_clk); - ret = clk_enable(wdt_clk); + ret = clk_prepare_enable(wdt_clk); if (ret) - goto out; + return ret; pnx4008_wdd.bootstatus = (readl(WDTIM_RES(wdt_base)) & WDOG_RESET) ? WDIOF_CARDRESET : 0; + pnx4008_wdd.parent = &pdev->dev; watchdog_set_nowayout(&pnx4008_wdd, nowayout); pnx4008_wdt_stop(&pnx4008_wdd); /* disable for now */ @@ -185,9 +184,7 @@ return 0; disable_clk: - clk_disable(wdt_clk); -out: - clk_put(wdt_clk); + clk_disable_unprepare(wdt_clk); return ret; } @@ -195,8 +192,7 @@ { watchdog_unregister_device(&pnx4008_wdd); - clk_disable(wdt_clk); - clk_put(wdt_clk); + clk_disable_unprepare(wdt_clk); return 0; } @@ -212,7 +208,6 @@ static struct platform_driver platform_wdt_driver = { .driver = { .name = "pnx4008-watchdog", - .owner = THIS_MODULE, .of_match_table = of_match_ptr(pnx4008_wdt_match), }, .probe = pnx4008_wdt_probe, @@ -222,7 +217,7 @@ module_platform_driver(platform_wdt_driver); MODULE_AUTHOR("MontaVista Software, Inc. "); -MODULE_AUTHOR("Wolfram Sang "); +MODULE_AUTHOR("Wolfram Sang "); MODULE_DESCRIPTION("PNX4008 Watchdog Driver"); module_param(heartbeat, uint, 0); @@ -236,5 +231,4 @@ "Set to 1 to keep watchdog running after device release"); MODULE_LICENSE("GPL"); -MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); MODULE_ALIAS("platform:pnx4008-watchdog");