From: Axel Lin Date: Sat, 21 Jan 2012 07:08:38 +0000 (+0800) Subject: watchdog: via_wdt: Set min_timeout and max_timeout for wdt_dev X-Git-Tag: v3.3-rc2~17^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f6dd94f8194408e11df4e33e1f7113612e84ca17;p=profile%2Fcommon%2Fkernel-common.git 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 Signed-off-by: Wim Van Sebroeck --- 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,