diff mbox series

[v2,1/1] watchdog: sp805: disable watchdog on remove

Message ID 20220414054233.1357-2-farbere@amazon.com
State New
Headers show
Series Use watchdog_stop_on_unregister() to stop sp805 watchdog when unregistering it | expand

Commit Message

Farber, Eliav April 14, 2022, 5:42 a.m. UTC
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 <farbere@amazon.com>
---
 drivers/watchdog/sp805_wdt.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Guenter Roeck April 26, 2022, 8:36 p.m. UTC | #1
On 4/13/22 22:42, Eliav Farber wrote:
> 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 <farbere@amazon.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

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

Guenter

> ---
>   drivers/watchdog/sp805_wdt.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c
> index d8876fba686d..69a6182c2dfe 100644
> --- a/drivers/watchdog/sp805_wdt.c
> +++ b/drivers/watchdog/sp805_wdt.c
> @@ -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.
diff mbox series

Patch

diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c
index d8876fba686d..69a6182c2dfe 100644
--- a/drivers/watchdog/sp805_wdt.c
+++ b/drivers/watchdog/sp805_wdt.c
@@ -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.