cyassl/wolfssl: update to 3.9.0
[openwrt/openwrt.git] / target / linux / ar71xx / patches-4.1 / 611-MIPS-ath79-wdt-timeout.patch
1 MIPS: ath79: fix maximum timeout
2
3 If the userland tries to set a timeout higher than the max_timeout, then we should fallback to max_timeout.
4
5 Signed-off-by: John Crispin <blogic@openwrt.org>
6
7 --- a/drivers/watchdog/ath79_wdt.c
8 +++ b/drivers/watchdog/ath79_wdt.c
9 @@ -114,10 +114,14 @@ static inline void ath79_wdt_disable(voi
10
11 static int ath79_wdt_set_timeout(int val)
12 {
13 - if (val < 1 || val > max_timeout)
14 + if (val < 1)
15 return -EINVAL;
16
17 - timeout = val;
18 + if (val > max_timeout)
19 + timeout = max_timeout;
20 + else
21 + timeout = val;
22 +
23 ath79_wdt_keepalive();
24
25 return 0;