Skip to contentSkip to conversation

Use watchdog_stop_on_unregister() to stop sp805 watchdog when unregistering it

PATCH In review Eliav Farber 2 participants 3 messages Apr 14, 2022 – Apr 26, 2022 Watchdog device drivers

lore
Share & tools
lore
#0 lore raw

v2 cover Use watchdog_stop_on_unregister() to stop sp805 watchdog when unregistering it

Use watchdog_stop_on_unregister() in probe instead of calling wdt_disable() from the remove function.

Eliav Farber (1):
watchdog: sp805: disable watchdog on remove

 drivers/watchdog/sp805_wdt.c | 1 +
 1 file changed, 1 insertion(+)
Signature · 1 line
2.32.0
#1 lore raw

PATCH v2 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.

---
 drivers/watchdog/sp805_wdt.c | 1 +
 1 file changed, 1 insertion(+)
drivers/watchdog/sp805_wdt.c +1 -0
index d8876fba686d..69a6182c2dfe 100644
@@ -273,6 +273,7 @@ sp805_wdt_probe(struct amba_device *adev, const struct amba_id *id)
 	watchdog_set_nowayout(&wdt->wdd, nowayout);
 	watchdog_set_drvdata(&wdt->wdd, wdt);
 	watchdog_set_restart_priority(&wdt->wdd, 128);
+	watchdog_stop_on_unregister(&wdt->wdd);
 
 	/*
 	 * If 'timeout-sec' devicetree property is specified, use that.
Signature · 1 line
2.32.0
maintainer Reviewed-by on v2 1/1
#2 lore raw

Re: [PATCH v2 1/1] watchdog: sp805: disable watchdog on remove

Quoted 5 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.

Note that sending an introduction is not necessary for individual patches.

Guenter

Quoted 16 lines
---
  drivers/watchdog/sp805_wdt.c | 1 +
  1 file changed, 1 insertion(+)
drivers/watchdog/sp805_wdt.c +1 -0
index d8876fba686d..69a6182c2dfe 100644
@@ -273,6 +273,7 @@ sp805_wdt_probe(struct amba_device *adev, const struct amba_id *id)
  	watchdog_set_nowayout(&wdt->wdd, nowayout);
  	watchdog_set_drvdata(&wdt->wdd, wdt);
  	watchdog_set_restart_priority(&wdt->wdd, 128);
+	watchdog_stop_on_unregister(&wdt->wdd);
 
  	/*
  	 * If 'timeout-sec' devicetree property is specified, use that.