From c1fd5f6402050b2463d0610b94f050fedf1b5019 Mon Sep 17 00:00:00 2001 From: Fabio Porcedda Date: Thu, 14 Feb 2013 09:14:25 +0100 Subject: watchdog: add timeout-sec property binding this patchset add the timeout-sec property to the following drivers: orion_wdt, pnx4008_wdt, s3c2410_wdt and at91sam9_wdt. The at91sam9_wdt is tested on evk-pr3, the other drivers are compile tested only. Signed-off-by: Fabio Porcedda Cc: Andrew Lunn Cc: Jason Cooper Cc: Wolfram Sang Cc: Masanari Iida Cc: Ben Dooks Cc: Kukjin Kim Cc: Andrew Victor Cc: Jean-Christophe PLAGNIOL-VILLARD Cc: Nicolas Ferre Signed-off-by: Wim Van Sebroeck --- drivers/watchdog/orion_wdt.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'drivers/watchdog/orion_wdt.c') diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c index 87ed2b9886a..da577980d39 100644 --- a/drivers/watchdog/orion_wdt.c +++ b/drivers/watchdog/orion_wdt.c @@ -140,6 +140,7 @@ static const struct watchdog_ops orion_wdt_ops = { static struct watchdog_device orion_wdt = { .info = &orion_wdt_info, .ops = &orion_wdt_ops, + .min_timeout = 1, }; static int orion_wdt_probe(struct platform_device *pdev) @@ -164,12 +165,9 @@ static int orion_wdt_probe(struct platform_device *pdev) wdt_max_duration = WDT_MAX_CYCLE_COUNT / wdt_tclk; - if ((heartbeat < 1) || (heartbeat > wdt_max_duration)) - heartbeat = wdt_max_duration; - - orion_wdt.timeout = heartbeat; - orion_wdt.min_timeout = 1; + orion_wdt.timeout = wdt_max_duration; orion_wdt.max_timeout = wdt_max_duration; + watchdog_init_timeout(&orion_wdt, heartbeat, &pdev->dev); watchdog_set_nowayout(&orion_wdt, nowayout); ret = watchdog_register_device(&orion_wdt); @@ -179,7 +177,7 @@ static int orion_wdt_probe(struct platform_device *pdev) } pr_info("Initial timeout %d sec%s\n", - heartbeat, nowayout ? ", nowayout" : ""); + orion_wdt.timeout, nowayout ? ", nowayout" : ""); return 0; } -- cgit v1.2.3