Skip to content

Commit

Permalink
[WATCHDOG] SA1100 watchdog maximum timeout
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Raphael Assenat authored and Wim Van Sebroeck committed Jul 9, 2009
1 parent db5d2d8 commit a6f052e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/watchdog/sa1100_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit a6f052e

Please sign in to comment.