summaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/imxwd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/watchdog/imxwd.c')
-rw-r--r--drivers/watchdog/imxwd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/watchdog/imxwd.c b/drivers/watchdog/imxwd.c
index dd11a62613..1952548fa7 100644
--- a/drivers/watchdog/imxwd.c
+++ b/drivers/watchdog/imxwd.c
@@ -97,9 +97,12 @@ static int imx21_watchdog_set_timeout(struct imx_wd *priv, int timeout)
dev_dbg(priv->dev, "%s: %d\n", __func__, timeout);
- if (!timeout || timeout > 128)
+ if (timeout < -1 || timeout > 128)
return -EINVAL;
+ if (timeout == 0) /* bit 2 (WDE) cannot be set to 0 again */
+ return -ENOSYS;
+
if (timeout > 0)
val = ((timeout * 2 - 1) << 8) | IMX21_WDOG_WCR_SRS |
IMX21_WDOG_WCR_WDA;