OpenWrt – Blame information for rev 4

Subversion Repositories:
Rev:
Rev Author Line No. Line
4 office 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 @@ -115,10 +115,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;