[PATCH v1 2/2] watchdog: wdat: add start_enable global parameter

From: Flavio Suligoi
Date: Mon Mar 08 2021 - 06:23:00 EST


The "start_enable" global parameter, managed in watchdog_core.c,
forces the driver to start the watchdog countdown in the same moment of the
module insertion.
The driver also updates the watchdog status, setting the WDOG_HW_RUNNING
flag, to enable the watchdog ping feature managed by the watchdog_core
itself.

Signed-off-by: Flavio Suligoi <f.suligoi@xxxxxxx>
---
drivers/watchdog/wdat_wdt.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/watchdog/wdat_wdt.c b/drivers/watchdog/wdat_wdt.c
index cec7917790e5..7304a335227f 100644
--- a/drivers/watchdog/wdat_wdt.c
+++ b/drivers/watchdog/wdat_wdt.c
@@ -437,6 +437,8 @@ static int wdat_wdt_probe(struct platform_device *pdev)
}

wdat_wdt_boot_status(wdat);
+ if (watchdog_global_param_start_enabled())
+ wdat_wdt_start(&wdat->wdd);
wdat_wdt_set_running(wdat);

ret = wdat_wdt_enable_reboot(wdat);
--
2.25.1