diff options
author | Raphael Assenat <raph@8d.com> | 2009-06-29 13:56:52 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2009-07-09 14:29:38 -0400 |
commit | a6f052e39c3832b5842c4f44d9b3a4295dacfc4a (patch) | |
tree | 28c758c809f680033cfd828ec09e944b70b4938d /drivers | |
parent | db5d2d8a5dfe0ae3e83ac618fd953ecc621adcdf (diff) |
[WATCHDOG] SA1100 watchdog maximum timeout
This patch replaces the hardcoded 255 seconds limit for a real limit based on
oscr_freq.
Also, the 'firmware_version' field is changed to '1' to allow the user
space application to easily detect that this driver supports a higher
maximum timeout.
Signed-off-by: Raphael Assenat <raph@8D.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/watchdog/sa1100_wdt.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/watchdog/sa1100_wdt.c b/drivers/watchdog/sa1100_wdt.c index ee1caae4d33b..016245419fad 100644 --- a/drivers/watchdog/sa1100_wdt.c +++ b/drivers/watchdog/sa1100_wdt.c | |||
@@ -38,7 +38,7 @@ | |||
38 | 38 | ||
39 | static unsigned long oscr_freq; | 39 | static unsigned long oscr_freq; |
40 | static unsigned long sa1100wdt_users; | 40 | static unsigned long sa1100wdt_users; |
41 | static int pre_margin; | 41 | static unsigned int pre_margin; |
42 | static int boot_status; | 42 | static int boot_status; |
43 | 43 | ||
44 | /* | 44 | /* |
@@ -84,6 +84,7 @@ static const struct watchdog_info ident = { | |||
84 | .options = WDIOF_CARDRESET | WDIOF_SETTIMEOUT | 84 | .options = WDIOF_CARDRESET | WDIOF_SETTIMEOUT |
85 | | WDIOF_KEEPALIVEPING, | 85 | | WDIOF_KEEPALIVEPING, |
86 | .identity = "SA1100/PXA255 Watchdog", | 86 | .identity = "SA1100/PXA255 Watchdog", |
87 | .firmware_version = 1, | ||
87 | }; | 88 | }; |
88 | 89 | ||
89 | static long sa1100dog_ioctl(struct file *file, unsigned int cmd, | 90 | static long sa1100dog_ioctl(struct file *file, unsigned int cmd, |
@@ -118,7 +119,7 @@ static long sa1100dog_ioctl(struct file *file, unsigned int cmd, | |||
118 | if (ret) | 119 | if (ret) |
119 | break; | 120 | break; |
120 | 121 | ||
121 | if (time <= 0 || time > 255) { | 122 | if (time <= 0 || (oscr_freq * (long long)time >= 0xffffffff)) { |
122 | ret = -EINVAL; | 123 | ret = -EINVAL; |
123 | break; | 124 | break; |
124 | } | 125 | } |