[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1444340074-15437-7-git-send-email-sylvain.rochet@finsecur.com>
Date: Thu, 8 Oct 2015 23:34:34 +0200
From: Sylvain Rochet <sylvain.rochet@...secur.com>
To: Guenter Roeck <linux@...ck-us.net>,
Boris BREZILLON <boris.brezillon@...e-electrons.com>,
linux-kernel@...r.kernel.org,
Nicolas Ferre <nicolas.ferre@...el.com>,
Ludovic Desroches <ludovic.desroches@...el.com>,
linux-arm-kernel@...ts.infradead.org,
Alexandre Belloni <alexandre.belloni@...e-electrons.com>,
Wenyou Yang <wenyou.yang@...el.com>,
Wim Van Sebroeck <wim@...ana.be>
Cc: Sylvain Rochet <sylvain.rochet@...secur.com>
Subject: [PATCH 6/6] watchdog: sama5d4: try to set timeout from device tree first
watchdog_init_timeout function doesn't try to get the "timeout-sec" DT
property if timeout_parm is not zero. This change makes this DT property
working for the sama5d4 watchdog driver.
Signed-off-by: Sylvain Rochet <sylvain.rochet@...secur.com>
---
drivers/watchdog/sama5d4_wdt.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/watchdog/sama5d4_wdt.c b/drivers/watchdog/sama5d4_wdt.c
index a49634c..2e2049b 100644
--- a/drivers/watchdog/sama5d4_wdt.c
+++ b/drivers/watchdog/sama5d4_wdt.c
@@ -222,7 +222,10 @@ static int sama5d4_wdt_probe(struct platform_device *pdev)
}
}
- ret = watchdog_init_timeout(wdd, wdt_timeout, &pdev->dev);
+ /* Try to set timeout from device tree first */
+ ret = watchdog_init_timeout(wdd, 0, &pdev->dev);
+ if (ret)
+ ret = watchdog_init_timeout(wdd, wdt_timeout, &pdev->dev);
if (ret) {
dev_err(&pdev->dev, "unable to set timeout value\n");
return ret;
@@ -243,7 +246,7 @@ static int sama5d4_wdt_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, wdt);
dev_info(&pdev->dev, "initialized (timeout = %d sec, nowayout = %d)\n",
- wdt_timeout, nowayout);
+ wdd->timeout, nowayout);
return 0;
}
--
2.5.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists