aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/via_wdt.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-01-21 02:08:38 -0500
committerWim Van Sebroeck <wim@iguana.be>2012-01-27 04:00:53 -0500
commitf6dd94f8194408e11df4e33e1f7113612e84ca17 (patch)
tree1291a7819c036375cd9696794f25d6bb023f9486 /drivers/watchdog/via_wdt.c
parentb1785dfd4fcd4011834f914810c1acb46b007a44 (diff)
watchdog: via_wdt: Set min_timeout and max_timeout for wdt_dev
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>
Diffstat (limited to 'drivers/watchdog/via_wdt.c')
-rw-r--r--drivers/watchdog/via_wdt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/watchdog/via_wdt.c b/drivers/watchdog/via_wdt.c
index 8b24b000062e..8f07dd4bd94a 100644
--- a/drivers/watchdog/via_wdt.c
+++ b/drivers/watchdog/via_wdt.c
@@ -124,8 +124,6 @@ static int wdt_stop(struct watchdog_device *wdd)
124static int wdt_set_timeout(struct watchdog_device *wdd, 124static int wdt_set_timeout(struct watchdog_device *wdd,
125 unsigned int new_timeout) 125 unsigned int new_timeout)
126{ 126{
127 if (new_timeout < 1 || new_timeout > WDT_TIMEOUT_MAX)
128 return -EINVAL;
129 writel(new_timeout, wdt_mem + VIA_WDT_COUNT); 127 writel(new_timeout, wdt_mem + VIA_WDT_COUNT);
130 timeout = new_timeout; 128 timeout = new_timeout;
131 return 0; 129 return 0;
@@ -150,6 +148,8 @@ static const struct watchdog_ops wdt_ops = {
150static struct watchdog_device wdt_dev = { 148static struct watchdog_device wdt_dev = {
151 .info = &wdt_info, 149 .info = &wdt_info,
152 .ops = &wdt_ops, 150 .ops = &wdt_ops,
151 .min_timeout = 1,
152 .max_timeout = WDT_TIMEOUT_MAX,
153}; 153};
154 154
155static int __devinit wdt_probe(struct pci_dev *pdev, 155static int __devinit wdt_probe(struct pci_dev *pdev,