Skip to content

Commit bd858e4

Browse files
morbidrsaWim Van Sebroeck
authored andcommitted
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 <jth@kernel.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20230418172531.177349-3-jth@kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
1 parent 87b2265 commit bd858e4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/watchdog/menz69_wdt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static int men_z069_wdt_set_timeout(struct watchdog_device *wdt,
7777
wdt->timeout = timeout;
7878
val = timeout * MEN_Z069_TIMER_FREQ;
7979

80-
reg = readw(drv->base + MEN_Z069_WVR);
80+
reg = readw(drv->base + MEN_Z069_WTR);
8181
ena = reg & MEN_Z069_WTR_WDEN;
8282
reg = ena | val;
8383
writew(reg, drv->base + MEN_Z069_WTR);

0 commit comments

Comments
 (0)