Skip to contentSkip to conversation

watchdog: Convert jz4740_wdt driver to watchdog core

PATCH Superseded Axel Lin 2 participants 2 messages Jan 24, 2012

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

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
index 877b107..32d48b8 100644
@@ -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
#1 lore raw
Quoted 11 lines · Axel Lin

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

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/  |