* [PATCH] watchdog: via_wdt: Set min_timeout and max_timeout for wdt_dev
@ 2012-01-21 7:08 Axel Lin
0 siblings, 0 replies; only message in thread
From: Axel Lin @ 2012-01-21 7:08 UTC (permalink / raw)
To: linux-kernel; +Cc: Marc Vertes, Wim Van Sebroeck, linux-watchdog
Let the watchdog core to check the valid value range of min_timeout/max_timeout.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/watchdog/via_wdt.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/watchdog/via_wdt.c b/drivers/watchdog/via_wdt.c
index 8b24b00..8f07dd4 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)
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;
@@ -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,
--
1.7.5.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-01-21 7:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-21 7:08 [PATCH] watchdog: via_wdt: Set min_timeout and max_timeout for wdt_dev Axel Lin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).