Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

watchdog: omap: use watchdog_init_timeout instead of open coding it

Instead of (partly) open coding watchdog_init_timeout to determine the
inital timeout use the core function that exists for exactly this
purpose.

As a side effect the "timeout-sec" device-tree property is recognized now
(though currently unused in the omap device trees).

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>

authored by

Uwe Kleine-König and committed by
Wim Van Sebroeck
a4f741e3 83efa1cb

+4 -4
+3
Documentation/devicetree/bindings/watchdog/omap-wdt.txt
··· 4 4 - compatible : "ti,omap3-wdt" for OMAP3 or "ti,omap4-wdt" for OMAP4 5 5 - ti,hwmods : Name of the hwmod associated to the WDT 6 6 7 + Optional properties: 8 + - timeout-sec : default watchdog timeout in seconds 9 + 7 10 Examples: 8 11 9 12 wdt2: wdt@4a314000 {
+1 -4
drivers/watchdog/omap_wdt.c
··· 234 234 omap_wdt->min_timeout = TIMER_MARGIN_MIN; 235 235 omap_wdt->max_timeout = TIMER_MARGIN_MAX; 236 236 237 - if (timer_margin >= TIMER_MARGIN_MIN && 238 - timer_margin <= TIMER_MARGIN_MAX) 239 - omap_wdt->timeout = timer_margin; 240 - else 237 + if (watchdog_init_timeout(omap_wdt, timer_margin, &pdev->dev) < 0) 241 238 omap_wdt->timeout = TIMER_MARGIN_DEFAULT; 242 239 243 240 watchdog_set_drvdata(omap_wdt, wdev);