diff mbox series

[4/5] watchdog: meson_gxbb_wdt: add stop_on_unregister

Message ID 20210623024429.1346349-5-art@khadas.com (mailing list archive)
State New, archived
Headers show
Series watchdog: meson_gxbb_wdt: improve | expand

Commit Message

Artem Lapkin June 23, 2021, 2:44 a.m. UTC
Added missed watchdog_stop_on_unregister call

Signed-off-by: Artem Lapkin <art@khadas.com>
---
 drivers/watchdog/meson_gxbb_wdt.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Guenter Roeck June 27, 2021, 3:42 p.m. UTC | #1
On 6/22/21 7:44 PM, Artem Lapkin wrote:
> Added missed watchdog_stop_on_unregister call
> 

This is again personal opinion and needs an acknowledgement
by driver authors. It is only necessary if one wants to support
that the watchdog is force-stopped by killing the watchdog daemon
(which leaves the watchdog running) and subsequently unloading
the driver. The call is not 'missing'; otherwise the core could
just do it. For that reason it should not be added with the argument
that it would be 'missing'. This will require a better argument.
Why is that call needed ? What is the use case ?

Guenter

> Signed-off-by: Artem Lapkin <art@khadas.com>
> ---
>   drivers/watchdog/meson_gxbb_wdt.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/watchdog/meson_gxbb_wdt.c b/drivers/watchdog/meson_gxbb_wdt.c
> index 0bf5dccf70b1..2dbe254e5122 100644
> --- a/drivers/watchdog/meson_gxbb_wdt.c
> +++ b/drivers/watchdog/meson_gxbb_wdt.c
> @@ -196,6 +196,7 @@ static int meson_gxbb_wdt_probe(struct platform_device *pdev)
>   
>   	meson_gxbb_wdt_set_timeout(&data->wdt_dev, data->wdt_dev.timeout);
>   	watchdog_set_nowayout(&data->wdt_dev, nowayout);
> +	watchdog_stop_on_unregister(&data->wdt_dev);
>   
>   	return devm_watchdog_register_device(dev, &data->wdt_dev);
>   }
>
diff mbox series

Patch

diff --git a/drivers/watchdog/meson_gxbb_wdt.c b/drivers/watchdog/meson_gxbb_wdt.c
index 0bf5dccf70b1..2dbe254e5122 100644
--- a/drivers/watchdog/meson_gxbb_wdt.c
+++ b/drivers/watchdog/meson_gxbb_wdt.c
@@ -196,6 +196,7 @@  static int meson_gxbb_wdt_probe(struct platform_device *pdev)
 
 	meson_gxbb_wdt_set_timeout(&data->wdt_dev, data->wdt_dev.timeout);
 	watchdog_set_nowayout(&data->wdt_dev, nowayout);
+	watchdog_stop_on_unregister(&data->wdt_dev);
 
 	return devm_watchdog_register_device(dev, &data->wdt_dev);
 }