watchdog: sp805: disable watchdog on remove
PATCH 1/1 watchdog: sp805: disable watchdog on remove
Disable the watchdog if it is active while removing the module. It is necessary in order to prevent a reset in case watchdog hw was running before the removal.
Signed-off-by Eliav Farber <[email protected]>
--- drivers/watchdog/sp805_wdt.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/watchdog/sp805_wdt.c +3 -0
@@ -311,6 +311,9 @@ static int sp805_wdt_remove(struct amba_device *adev) {struct sp805_wdt *wdt =amba_get_drvdata (adev); +if (watchdog_active (&wdt->wdd)) +wdt_disable (&wdt->wdd); +watchdog_unregister_device (&wdt->wdd);watchdog_set_drvdata (&wdt->wdd,NULL );
Signature · 1 line
2.32.0
Guenter Roeck
maintainerQuoted 14 lines · Eliav Farber
Disable the watchdog if it is active while removing the module. It is necessary in order to prevent a reset in case watchdog hw was running before the removal.
Signed-off-by Eliav Farber <[email protected]>--- drivers/watchdog/sp805_wdt.c | 3 +++ 1 file changed, 3 insertions(+)drivers/watchdog/sp805_wdt.c +0
-0
drivers/watchdog/sp805_wdt.c static int sp805_wdt_remove(struct amba_device *adev) · line 316
Quoted 6 lines
drivers/watchdog/sp805_wdt.c +3
-0@@ -311,6 +311,9 @@ static int sp805_wdt_remove(struct amba_device *adev) {struct sp805_wdt *wdt =amba_get_drvdata (adev); +if (watchdog_active (&wdt->wdd)) +wdt_disable (&wdt->wdd); +
Why not use watchdog_stop_on_unregister() ?
Guenter
Quoted 3 lines
drivers/watchdog/sp805_wdt.c +0
-0watchdog_unregister_device (&wdt->wdd);watchdog_set_drvdata (&wdt->wdd,NULL );
Quoted 1 line · Guenter Roeck
Why not use
watchdog_stop_on_unregister()?
I'll use watchdog_stop_on_unregister() instead of my change.