public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 1/3] watchdog: imgpdc: Allow timeout to be set in device-tree
@ 2015-04-01 17:43 Andrew Bresticker
  2015-04-01 17:43 ` [PATCH V2 2/3] watchdog: imgpdc: Set timeout before starting watchdog Andrew Bresticker
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Andrew Bresticker @ 2015-04-01 17:43 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck
  Cc: linux-watchdog, linux-kernel, Andrew Bresticker, Ezequiel Garcia,
	James Hogan

Since the heartbeat is statically initialized to its default value,
watchdog_init_timeout() will never look in the device-tree for a
timeout-sec value.  Instead of statically initializing heartbeat,
fall back to the default timeout value if watchdog_init_timeout()
fails.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Cc: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
Cc: James Hogan <james.hogan@imgtec.com>
---
New for v2.
---
 drivers/watchdog/imgpdc_wdt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/watchdog/imgpdc_wdt.c b/drivers/watchdog/imgpdc_wdt.c
index 0deaa4f..89b2abc 100644
--- a/drivers/watchdog/imgpdc_wdt.c
+++ b/drivers/watchdog/imgpdc_wdt.c
@@ -42,7 +42,7 @@
 #define PDC_WDT_MIN_TIMEOUT		1
 #define PDC_WDT_DEF_TIMEOUT		64
 
-static int heartbeat = PDC_WDT_DEF_TIMEOUT;
+static int heartbeat;
 module_param(heartbeat, int, 0);
 MODULE_PARM_DESC(heartbeat, "Watchdog heartbeats in seconds "
 	"(default=" __MODULE_STRING(PDC_WDT_DEF_TIMEOUT) ")");
@@ -195,9 +195,9 @@ static int pdc_wdt_probe(struct platform_device *pdev)
 
 	ret = watchdog_init_timeout(&pdc_wdt->wdt_dev, heartbeat, &pdev->dev);
 	if (ret < 0) {
-		pdc_wdt->wdt_dev.timeout = pdc_wdt->wdt_dev.max_timeout;
+		pdc_wdt->wdt_dev.timeout = PDC_WDT_DEF_TIMEOUT;
 		dev_warn(&pdev->dev,
-			 "Initial timeout out of range! setting max timeout\n");
+			 "Initial timeout out of range! setting default timeout\n");
 	}
 
 	pdc_wdt_stop(&pdc_wdt->wdt_dev);
-- 
2.2.0.rc0.207.ga3a616c


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-04-03  5:38 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-01 17:43 [PATCH V2 1/3] watchdog: imgpdc: Allow timeout to be set in device-tree Andrew Bresticker
2015-04-01 17:43 ` [PATCH V2 2/3] watchdog: imgpdc: Set timeout before starting watchdog Andrew Bresticker
2015-04-01 17:43 ` [PATCH V2 3/3] watchdog: imgpdc: Add reboot support Andrew Bresticker
2015-04-01 22:22 ` [PATCH V2 1/3] watchdog: imgpdc: Allow timeout to be set in device-tree James Hogan
2015-04-01 22:42   ` Andrew Bresticker
2015-04-02  1:08   ` Guenter Roeck
2015-04-02 16:46     ` Andrew Bresticker
2015-04-03  1:52       ` Guenter Roeck
2015-04-03  2:16         ` Andrew Bresticker
2015-04-03  2:35           ` Guenter Roeck
2015-04-03  5:38             ` Guenter Roeck
2015-04-02  1:42   ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox