Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1242745

[PATCH 6/6] watchdog: sama5d4: try to set timeout from device tree first

From Sylvain Rochet <sylvain.rochet@finsecur.com>
Newsgroups linux.kernel
Subject [PATCH 6/6] watchdog: sama5d4: try to set timeout from device tree first
Date 2015-10-08 23:40 +0200
Message-ID <qhr4S-7fJ-19@gated-at.bofh.it> (permalink)
References <qhr4S-7fJ-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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@finsecur.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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] watchdog: sama5d4 and at91sam9: trivial rework Sylvain Rochet <sylvain.rochet@finsecur.com> - 2015-10-08 23:40 +0200
  [PATCH 5/6] watchdog: at91sam9: remove unused pdata support Sylvain Rochet <sylvain.rochet@finsecur.com> - 2015-10-08 23:40 +0200
  [PATCH 6/6] watchdog: sama5d4: try to set timeout from device tree first Sylvain Rochet <sylvain.rochet@finsecur.com> - 2015-10-08 23:40 +0200
    Re: [PATCH 6/6] watchdog: sama5d4: try to set timeout from device  tree first Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2015-10-12 10:00 +0200
      RE: [PATCH 6/6] watchdog: sama5d4: try to set timeout from device  tree first "Yang, Wenyou" <Wenyou.Yang@atmel.com> - 2015-10-12 10:20 +0200
        Re: [PATCH 6/6] watchdog: sama5d4: try to set timeout from device  tree first Sylvain Rochet <sylvain.rochet@finsecur.com> - 2015-10-12 16:00 +0200
      Re: [PATCH 6/6] watchdog: sama5d4: try to set timeout from device  tree first Sylvain Rochet <sylvain.rochet@finsecur.com> - 2015-10-12 11:10 +0200
  [PATCH 2/6] watchdog: at91sam9: use watchdog_get_drvdata instead of container_of Sylvain Rochet <sylvain.rochet@finsecur.com> - 2015-10-08 23:40 +0200
  [PATCH 4/6] watchdog: at91sam9: remove nowayout useless copy Sylvain Rochet <sylvain.rochet@finsecur.com> - 2015-10-08 23:40 +0200

csiph-web