[PATCH v1 4/6] watchdog: set some reasonable timeout_max value if no other is available
Oleksij Rempel
o.rempel at pengutronix.de
Thu Mar 8 03:05:13 PST 2018
Some drivers do not provide timeout_max value.
Using some value is probbaly better then setting timeout_max to 0.
Signed-off-by: Oleksij Rempel <o.rempel at pengutronix.de>
---
drivers/watchdog/wd_core.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/watchdog/wd_core.c b/drivers/watchdog/wd_core.c
index 97e2ab568..66dbd790d 100644
--- a/drivers/watchdog/wd_core.c
+++ b/drivers/watchdog/wd_core.c
@@ -41,6 +41,10 @@ int watchdog_register(struct watchdog *wd)
if (!wd->priority)
wd->priority = WATCHDOG_DEFAULT_PRIORITY;
+ /* set some default sane value */
+ if (!wd->timeout_max)
+ wd->timeout_max = 60 * 4;
+
dev_add_param_uint32_ro(&wd->dev, "timeout_max",
&wd->timeout_max, "%u");
--
2.16.1
More information about the barebox
mailing list