diff options
author | Guenter Roeck <linux@roeck-us.net> | 2019-04-08 12:38:41 -0700 |
---|---|---|
committer | Wim Van Sebroeck <wim@linux-watchdog.org> | 2019-05-05 21:02:20 +0200 |
commit | 77d9f766fe36f902125f84a1c901fa72d2157359 (patch) | |
tree | e231265a05db68099ba9646f1fa534429d7c07fc /drivers/watchdog/iTCO_wdt.c | |
parent | 3564fbc54f9214194a348e7f7b606dc9313bc92c (diff) | |
download | lwn-77d9f766fe36f902125f84a1c901fa72d2157359.tar.gz lwn-77d9f766fe36f902125f84a1c901fa72d2157359.zip |
watchdog: iTCO_wdt: Various improvements
Various coccinelle driven transformations as detailed below.
The conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts
used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches
- Use watchdog_stop_on_unregister to stop the watchdog on remove
- Drop assignments to otherwise unused variables
- Drop empty remove function
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Diffstat (limited to 'drivers/watchdog/iTCO_wdt.c')
-rw-r--r-- | drivers/watchdog/iTCO_wdt.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c index 0a5318b7865e..89cea6ce9a08 100644 --- a/drivers/watchdog/iTCO_wdt.c +++ b/drivers/watchdog/iTCO_wdt.c @@ -545,6 +545,7 @@ static int iTCO_wdt_probe(struct platform_device *pdev) } watchdog_stop_on_reboot(&p->wddev); + watchdog_stop_on_unregister(&p->wddev); ret = devm_watchdog_register_device(dev, &p->wddev); if (ret != 0) { pr_err("cannot register watchdog device (err=%d)\n", ret); @@ -557,17 +558,6 @@ static int iTCO_wdt_probe(struct platform_device *pdev) return 0; } -static int iTCO_wdt_remove(struct platform_device *pdev) -{ - struct iTCO_wdt_private *p = platform_get_drvdata(pdev); - - /* Stop the timer before we leave */ - if (!nowayout) - iTCO_wdt_stop(&p->wddev); - - return 0; -} - #ifdef CONFIG_PM_SLEEP /* * Suspend-to-idle requires this, because it stops the ticks and timekeeping, so @@ -620,7 +610,6 @@ static const struct dev_pm_ops iTCO_wdt_pm = { static struct platform_driver iTCO_wdt_driver = { .probe = iTCO_wdt_probe, - .remove = iTCO_wdt_remove, .driver = { .name = DRV_NAME, .pm = ITCO_WDT_PM_OPS, |