To reduce code duplicate and increase code readability use WDT core
code to handle WDT interface.
Remove io_lock as the WDT core uses mutex to lock each wdt device.
Remove wdt_state as the WDT core tracks state with its own variable.
The watchdog_init_timeout() can read timeout value from timeout-sec
property if the passed value is out of bounds. The heartbeat is
initialized in next way. If heartbeat is not set thought module
parameter, try to read it's value from WDT node timeout-sec property.
If node has no one, use default value.
The heartbeat is hold in wdd->timeout by WDT core, so use it in
order to set timeout period.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@xxxxxx>
Acked-by: Santosh Shilimkar <santosh.shilimkar@xxxxxx>
Reviewed-by: Guenter Roeck <linux@xxxxxxxxxxxx>
---
arch/arm/mach-davinci/da8xx-dt.c | 2 +-
arch/arm/mach-davinci/devices-da8xx.c | 4 +-
arch/arm/mach-davinci/devices.c | 2 +-
drivers/watchdog/Kconfig | 2 +
drivers/watchdog/davinci_wdt.c | 151 ++++++++-------------------------
5 files changed, 43 insertions(+), 118 deletions(-)
[...]
diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
index d2bc574..ed19287 100644
-MODULE_ALIAS("platform:watchdog");Regards,
+MODULE_ALIAS("platform:davinci-wdt");