aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/sbsa_gwdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/watchdog/sbsa_gwdt.c')
-rw-r--r--drivers/watchdog/sbsa_gwdt.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/watchdog/sbsa_gwdt.c b/drivers/watchdog/sbsa_gwdt.c
index f0f1e3b2e463..4cbe6ba52754 100644
--- a/drivers/watchdog/sbsa_gwdt.c
+++ b/drivers/watchdog/sbsa_gwdt.c
@@ -121,6 +121,7 @@ static int sbsa_gwdt_set_timeout(struct watchdog_device *wdd,
struct sbsa_gwdt *gwdt = watchdog_get_drvdata(wdd);
wdd->timeout = timeout;
+ timeout = clamp_t(unsigned int, timeout, 1, wdd->max_hw_heartbeat_ms / 1000);
if (action)
writel(gwdt->clk * timeout,