]> Git Repo - J-linux.git/commitdiff
watchdog: rti: of: honor timeout-sec property
authorAlexander Sverdlin <[email protected]>
Thu, 7 Nov 2024 20:38:28 +0000 (21:38 +0100)
committerWim Van Sebroeck <[email protected]>
Sun, 17 Nov 2024 10:24:22 +0000 (11:24 +0100)
Currently "timeout-sec" Device Tree property is being silently ignored:
even though watchdog_init_timeout() is being used, the driver always passes
"heartbeat" == DEFAULT_HEARTBEAT == 60 as argument.

Fix this by setting struct watchdog_device::timeout to DEFAULT_HEARTBEAT
and passing real module parameter value to watchdog_init_timeout() (which
may now be 0 if not specified).

Cc: [email protected]
Fixes: 2d63908bdbfb ("watchdog: Add K3 RTI watchdog support")
Signed-off-by: Alexander Sverdlin <[email protected]>
Reviewed-by: Vignesh Raghavendra <[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]>
drivers/watchdog/rti_wdt.c

index f410b6e39fb6f61228e1e5342bb8aa1bb3b11747..58c9445c0f885ca44c221a2cc145fc7d56e55de1 100644 (file)
@@ -61,7 +61,7 @@
 
 #define MAX_HW_ERROR           250
 
-static int heartbeat = DEFAULT_HEARTBEAT;
+static int heartbeat;
 
 /*
  * struct to hold data for each WDT device
@@ -252,6 +252,7 @@ static int rti_wdt_probe(struct platform_device *pdev)
        wdd->min_timeout = 1;
        wdd->max_hw_heartbeat_ms = (WDT_PRELOAD_MAX << WDT_PRELOAD_SHIFT) /
                wdt->freq * 1000;
+       wdd->timeout = DEFAULT_HEARTBEAT;
        wdd->parent = dev;
 
        watchdog_set_drvdata(wdd, wdt);
This page took 0.057071 seconds and 4 git commands to generate.