summaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/sa1100_wdt.c
diff options
context:
space:
mode:
authorRaphael Assenat <raph@8d.com>2009-06-29 13:56:52 -0400
committerWim Van Sebroeck <wim@iguana.be>2009-07-09 18:29:38 +0000
commita6f052e39c3832b5842c4f44d9b3a4295dacfc4a (patch)
tree28c758c809f680033cfd828ec09e944b70b4938d /drivers/watchdog/sa1100_wdt.c
parentdb5d2d8a5dfe0ae3e83ac618fd953ecc621adcdf (diff)
downloadblackbird-op-linux-a6f052e39c3832b5842c4f44d9b3a4295dacfc4a.tar.gz
blackbird-op-linux-a6f052e39c3832b5842c4f44d9b3a4295dacfc4a.zip
[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/watchdog/sa1100_wdt.c')
-rw-r--r--drivers/watchdog/sa1100_wdt.c5
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 @@
static unsigned long oscr_freq;
static unsigned long sa1100wdt_users;
-static int pre_margin;
+static unsigned int pre_margin;
static int boot_status;
/*
@@ -84,6 +84,7 @@ static const struct watchdog_info ident = {
.options = WDIOF_CARDRESET | WDIOF_SETTIMEOUT
| WDIOF_KEEPALIVEPING,
.identity = "SA1100/PXA255 Watchdog",
+ .firmware_version = 1,
};
static long sa1100dog_ioctl(struct file *file, unsigned int cmd,
@@ -118,7 +119,7 @@ static long sa1100dog_ioctl(struct file *file, unsigned int cmd,
if (ret)
break;
- if (time <= 0 || time > 255) {
+ if (time <= 0 || (oscr_freq * (long long)time >= 0xffffffff)) {
ret = -EINVAL;
break;
}
OpenPOWER on IntegriCloud