Re: [PATCH 3/4] watchdog: gpio: change order for setting default timeout

From: Guenter Roeck
Date: Sat Feb 10 2018 - 22:55:32 EST


On 02/10/2018 12:36 PM, Marcus Folkesson wrote:
watchdog_init_timeout() will preserve wdd->timeout value if
no parameter nor timeout-secs dt property is set.

Signed-off-by: Marcus Folkesson <marcus.folkesson@xxxxxxxxx>

Reviewed-by: Guenter Roeck <linux@xxxxxxxxxxxx>

---
drivers/watchdog/gpio_wdt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/watchdog/gpio_wdt.c b/drivers/watchdog/gpio_wdt.c
index cb66c2f99ff1..d0e8203f7a60 100644
--- a/drivers/watchdog/gpio_wdt.c
+++ b/drivers/watchdog/gpio_wdt.c
@@ -156,9 +156,9 @@ static int gpio_wdt_probe(struct platform_device *pdev)
priv->wdd.min_timeout = SOFT_TIMEOUT_MIN;
priv->wdd.max_hw_heartbeat_ms = hw_margin;
priv->wdd.parent = &pdev->dev;
+ priv->wdd.timeout = SOFT_TIMEOUT_DEF;
- if (watchdog_init_timeout(&priv->wdd, 0, &pdev->dev) < 0)
- priv->wdd.timeout = SOFT_TIMEOUT_DEF;
+ watchdog_init_timeout(&priv->wdd, 0, &pdev->dev);
watchdog_stop_on_reboot(&priv->wdd);