Skip to content

Commit ec90349

Browse files
marcusfolkessonWim Van Sebroeck
authored andcommitted
watchdog: da9052_wdt: use timeout value from external inputs
Introduce the `timeout` module parameter and pass it to watchdog_init_timeout(). If the parameter is not set or contains an invalid value, fallback on the `timeout-secs` devicetree property value. If none of the above is valid, go for the old default value. Signed-off-by: Marcus Folkesson <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
1 parent 776d14d commit ec90349

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/watchdog/da9052_wdt.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ MODULE_PARM_DESC(nowayout,
3636
"Watchdog cannot be stopped once started (default="
3737
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
3838

39+
static int timeout;
40+
module_param(timeout, int, 0);
41+
MODULE_PARM_DESC(timeout,
42+
"Watchdog timeout in seconds. (default = "
43+
__MODULE_STRING(WDT_DEFAULT_TIMEOUT) ")");
44+
3945
static const struct {
4046
u8 reg_val;
4147
int time; /* Seconds */
@@ -178,6 +184,7 @@ static int da9052_wdt_probe(struct platform_device *pdev)
178184
da9052_wdt->ops = &da9052_wdt_ops;
179185
da9052_wdt->parent = dev;
180186
watchdog_set_drvdata(da9052_wdt, driver_data);
187+
watchdog_init_timeout(da9052_wdt, timeout, dev);
181188
watchdog_set_nowayout(da9052_wdt, nowayout);
182189

183190
if (da9052->fault_log & DA9052_FAULTLOG_TWDERROR)

0 commit comments

Comments
 (0)