watchdog: Convert jz4740_wdt driver to watchdog core
Subsystems (2)
PATCH v2 1/1 watchdog: Convert jz4740_wdt driver to watchdog core
This patch converts jz4740_wdt driver to use watchdog core APIs. Also use devm_* APIs to save a few error handling code.
---
v2: Address all the comments by Wolfram.
- Remove unneeded header file inclusion
- Drop 'heartbeat' usage in jz4740_wdt_set_heartbeat and jz4740_wdt_start
- Init wdt_dev->timeout in probe using the global 'heartbeat'
- Remove unneeded pointer check for drvdata->mem
drivers/watchdog/Kconfig | 1 + drivers/watchdog/jz4740_wdt.c | 254 +++++++++++++--------------------------- 2 files changed, 84 insertions(+), 171 deletions(-)
drivers/watchdog/Kconfig +1 -0
@@ -955,6 +955,7 @@ config INDYDOG config JZ4740_WDT tristate "Ingenic jz4740 SoC hardware watchdog" depends on MACH_JZ4740 + select WATCHDOG_CORE help Hardware driver for the built-in watchdog timer on Ingenic jz4740 SoCs.
drivers/watchdog/jz4740_wdt.c +83 -171
345 lines not on this page · raw message
Signature · 1 line
1.7.5.4
Quoted 11 lines · Axel Lin
This patch converts
jz4740_wdtdriver to use watchdog core APIs. Also use devm_* APIs to save a few error handling code.Signed-off-by Axel Lin <[email protected]>Acked-by Paul Cercueil <[email protected]>---
v2: Address all the comments by Wolfram.
- Remove unneeded header file inclusion
- Drop 'heartbeat' usage injz4740_wdt_set_heartbeatandjz4740_wdt_start
- Initwdt_dev->timeoutin probe using the global 'heartbeat'
- Remove unneeded pointer check fordrvdata->mem
The code still has those:
41 #define WDT_IN_USE 0
42 #define WDT_OK_TO_CLOSE 1
drivers/watchdog/jz4740_wdt.c line 72
Quoted 4 lines
drivers/watchdog/jz4740_wdt.c +4
-0+struct jz4740_wdt_drvdata { +struct watchdog_device wdt; +void __iomem *base; +struct resource *mem;
mem can go, too.
drivers/watchdog/jz4740_wdt.c line 74
Quoted 2 lines
drivers/watchdog/jz4740_wdt.c +2
-0+struct clk *rtc_clk; +};
Rest looks fine.
Thanks,
Wolfram
Signature · 2 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ |