summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Fransson <per.xx.fransson@stericsson.com>2012-01-12 11:38:44 +0100
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:01:18 +0200
commit83f68a69c23b069d0b71d3a45061acff3b60b98f (patch)
tree4e795a910e6715e3dca48e40500dfbe2269946a3
parentb466e3dea99f96105e26f65d211c94572bb7097e (diff)
drivers:watchdog:ux500: Disable when timeout == 0
Setting the watchdog timeout to 0 makes any attempt to open the dev node fail. This makes it possible to disable the watchdog functionality on the kernel commandline with "ux500_wdt.timeout=0", ST-Ericsson ID: 365851 ST-Ericsson Linux next:NA ST-Ericsson FOSS-OUT ID:Trivial Change-Id: I917258c9310ea2267c877c3c13d00dc08c30a147 Signed-off-by: Per Fransson <per.xx.fransson@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/45299 Reviewed-by: QATOOLS Reviewed-by: QABUILD Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
-rw-r--r--drivers/watchdog/ux500_wdt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/watchdog/ux500_wdt.c b/drivers/watchdog/ux500_wdt.c
index 52747e59172..a1e8c2dbf10 100644
--- a/drivers/watchdog/ux500_wdt.c
+++ b/drivers/watchdog/ux500_wdt.c
@@ -44,6 +44,9 @@ static bool safe_close;
static int ux500_wdt_open(struct inode *inode, struct file *file)
{
+ if (!timeout)
+ return -ENODEV;
+
if (test_and_set_bit(WDT_FLAGS_OPEN, &wdt_flags))
return -EBUSY;