[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1009cf3a-587b-307a-d1c9-efe71cd0a104@roeck-us.net>
Date: Sat, 2 Apr 2022 22:41:20 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Eliav Farber <farbere@...zon.com>, wim@...ux-watchdog.org,
linux-watchdog@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: ronenk@...zon.com, talel@...zon.com, hhhawa@...zon.com,
jonnyc@...zon.com, hanochu@...zon.com, dwmw@...zon.co.uk
Subject: Re: [PATCH] watchdog: sp805: disable watchdog on remove
On 4/2/22 22:22, 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@...zon.com>
> ---
> drivers/watchdog/sp805_wdt.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c
> index d8876fba686d..d7dc0f3f16ec 100644
> --- a/drivers/watchdog/sp805_wdt.c
> +++ b/drivers/watchdog/sp805_wdt.c
> @@ -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
> watchdog_unregister_device(&wdt->wdd);
> watchdog_set_drvdata(&wdt->wdd, NULL);
>
Powered by blists - more mailing lists