aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/watchdog_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/watchdog/watchdog_core.c')
-rw-r--r--drivers/watchdog/watchdog_core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/watchdog/watchdog_core.c b/drivers/watchdog/watchdog_core.c
index 461336c4519f..cec9b559647d 100644
--- a/drivers/watchdog/watchdog_core.c
+++ b/drivers/watchdog/watchdog_core.c
@@ -78,7 +78,7 @@ int watchdog_init_timeout(struct watchdog_device *wdd,
78 watchdog_check_min_max_timeout(wdd); 78 watchdog_check_min_max_timeout(wdd);
79 79
80 /* try to get the timeout module parameter first */ 80 /* try to get the timeout module parameter first */
81 if (!watchdog_timeout_invalid(wdd, timeout_parm)) { 81 if (!watchdog_timeout_invalid(wdd, timeout_parm) && timeout_parm) {
82 wdd->timeout = timeout_parm; 82 wdd->timeout = timeout_parm;
83 return ret; 83 return ret;
84 } 84 }
@@ -89,7 +89,7 @@ int watchdog_init_timeout(struct watchdog_device *wdd,
89 if (dev == NULL || dev->of_node == NULL) 89 if (dev == NULL || dev->of_node == NULL)
90 return ret; 90 return ret;
91 of_property_read_u32(dev->of_node, "timeout-sec", &t); 91 of_property_read_u32(dev->of_node, "timeout-sec", &t);
92 if (!watchdog_timeout_invalid(wdd, t)) 92 if (!watchdog_timeout_invalid(wdd, t) && t)
93 wdd->timeout = t; 93 wdd->timeout = t;
94 else 94 else
95 ret = -EINVAL; 95 ret = -EINVAL;