Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

watchdog: booke_wdt: Use infrastructure to check timeout limits

The watchdog infrastructure checks the maximum timeout for us.
Use it.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>

authored by

Guenter Roeck and committed by
Wim Van Sebroeck
fa928ee8 64307b48

+1 -3
+1 -3
drivers/watchdog/booke_wdt.c
··· 186 186 static int booke_wdt_set_timeout(struct watchdog_device *wdt_dev, 187 187 unsigned int timeout) 188 188 { 189 - if (timeout > MAX_WDT_TIMEOUT) 190 - return -EINVAL; 191 189 wdt_dev->timeout = timeout; 192 190 booke_wdt_set(wdt_dev); 193 191 ··· 209 211 .info = &booke_wdt_info, 210 212 .ops = &booke_wdt_ops, 211 213 .min_timeout = 1, 212 - .max_timeout = 0xFFFF 213 214 }; 214 215 215 216 static void __exit booke_wdt_exit(void) ··· 226 229 booke_wdt_set_timeout(&booke_wdt_dev, 227 230 period_to_sec(booke_wdt_period)); 228 231 watchdog_set_nowayout(&booke_wdt_dev, nowayout); 232 + booke_wdt_dev.max_timeout = MAX_WDT_TIMEOUT; 229 233 if (booke_wdt_enabled) 230 234 booke_wdt_start(&booke_wdt_dev); 231 235