aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Thumshirn <[email protected]>2023-04-18 19:25:31 +0200
committerWim Van Sebroeck <[email protected]>2023-04-22 16:05:39 +0200
commitbd858e494ceb3aac25bab9c6639f4cd764f534ba (patch)
tree90c0a58461b47d5e95aad9c569cb669055218514
parent87b22656ca6a896d0378e9e60ffccb0c82f48b08 (diff)
watchdog: menz069_wdt: fix timeout setting
When setting the timeout for the menz069_wdt watchdog driver, we erroneously read from the 'watchdog value register' (WVR) instead of the 'watchdog timer register' (WTR) and then write the value back into WTR. This can potentially lead to wrong timeouts and wrong enable bit settings. Signed-off-by: Johannes Thumshirn <[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]>
-rw-r--r--drivers/watchdog/menz69_wdt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/watchdog/menz69_wdt.c b/drivers/watchdog/menz69_wdt.c
index bca0938f3429..3c98030b9fcd 100644
--- a/drivers/watchdog/menz69_wdt.c
+++ b/drivers/watchdog/menz69_wdt.c
@@ -77,7 +77,7 @@ static int men_z069_wdt_set_timeout(struct watchdog_device *wdt,
wdt->timeout = timeout;
val = timeout * MEN_Z069_TIMER_FREQ;
- reg = readw(drv->base + MEN_Z069_WVR);
+ reg = readw(drv->base + MEN_Z069_WTR);
ena = reg & MEN_Z069_WTR_WDEN;
reg = ena | val;
writew(reg, drv->base + MEN_Z069_WTR);