提交 f6dd94f8 编写于 作者: A Axel Lin 提交者: Wim Van Sebroeck

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: NAxel Lin <axel.lin@gmail.com>
Signed-off-by: NWim Van Sebroeck <wim@iguana.be>
上级 b1785dfd
...@@ -124,8 +124,6 @@ static int wdt_stop(struct watchdog_device *wdd) ...@@ -124,8 +124,6 @@ static int wdt_stop(struct watchdog_device *wdd)
static int wdt_set_timeout(struct watchdog_device *wdd, static int wdt_set_timeout(struct watchdog_device *wdd,
unsigned int new_timeout) unsigned int new_timeout)
{ {
if (new_timeout < 1 || new_timeout > WDT_TIMEOUT_MAX)
return -EINVAL;
writel(new_timeout, wdt_mem + VIA_WDT_COUNT); writel(new_timeout, wdt_mem + VIA_WDT_COUNT);
timeout = new_timeout; timeout = new_timeout;
return 0; return 0;
...@@ -150,6 +148,8 @@ static const struct watchdog_ops wdt_ops = { ...@@ -150,6 +148,8 @@ static const struct watchdog_ops wdt_ops = {
static struct watchdog_device wdt_dev = { static struct watchdog_device wdt_dev = {
.info = &wdt_info, .info = &wdt_info,
.ops = &wdt_ops, .ops = &wdt_ops,
.min_timeout = 1,
.max_timeout = WDT_TIMEOUT_MAX,
}; };
static int __devinit wdt_probe(struct pci_dev *pdev, static int __devinit wdt_probe(struct pci_dev *pdev,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册