Skip to content

Commit

Permalink
watchdog: via_wdt: Set min_timeout and max_timeout for wdt_dev
Browse files Browse the repository at this point in the history
Let the watchdog core to check the valid value range of min_timeout/max_timeout.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
  • Loading branch information
Axel Lin authored and Wim Van Sebroeck committed Jan 27, 2012
1 parent b1785df commit f6dd94f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/watchdog/via_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ static int wdt_stop(struct watchdog_device *wdd)
static int wdt_set_timeout(struct watchdog_device *wdd,
unsigned int new_timeout)
{
if (new_timeout < 1 || new_timeout > WDT_TIMEOUT_MAX)
return -EINVAL;
writel(new_timeout, wdt_mem + VIA_WDT_COUNT);
timeout = new_timeout;
return 0;
Expand All @@ -150,6 +148,8 @@ static const struct watchdog_ops wdt_ops = {
static struct watchdog_device wdt_dev = {
.info = &wdt_info,
.ops = &wdt_ops,
.min_timeout = 1,
.max_timeout = WDT_TIMEOUT_MAX,
};

static int __devinit wdt_probe(struct pci_dev *pdev,
Expand Down

0 comments on commit f6dd94f

Please sign in to comment.