Skip to content

watchdog: Expand use of device managed functions (series 3 of 3)

Guenter Roeck linux-watchdog lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest22 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/22watchdog: tegra_wdt: Use watchdog_stop_on_unregister and other improvementsdrivers/watchdog/tegra_wdt.c+7 -190 replies
2/22watchdog: tqmx86_wdt: Use 'dev' instead of dereferencing it repeatedlydrivers/watchdog/tqmx86_wdt.c+7 -70 replies
3/22watchdog: ts4800_wdt: Convert to use device managed functions and other improvementsdrivers/watchdog/ts4800_wdt.c+11 -220 replies
4/22watchdog: ts72xx_wdt: Use 'dev' instead of dereferencing it repeatedlydrivers/watchdog/ts72xx_wdt.c+6 -50 replies
5/22watchdog: twl4030_wdt: Convert to use device managed functions and other improvementsdrivers/watchdog/twl4030_wdt.c+4 -180 replies
6/22watchdog: uniphier_wdt: drop platform_set_drvdatadrivers/watchdog/uniphier_wdt.c+0 -20 replies
7/22watchdog: wdat_wdt: Use 'dev' instead of dereferencing it repeatedlydrivers/watchdog/wdat_wdt.c+14 -130 replies
8/22watchdog: wm831x_wdt: Use 'dev' instead of dereferencing it repeatedlydrivers/watchdog/wm831x_wdt.c+9 -100 replies
9/22watchdog: xen_wdt: Use 'dev' instead of dereferencing it repeatedlydrivers/watchdog/xen_wdt.c+9 -90 replies
10/22watchdog: imx_sc_wdt: Use 'dev' instead of dereferencing it repeatedlydrivers/watchdog/imx_sc_wdt.c+7 -61 reply
11/22watchdog: sbsa_gwdt: Convert to use device managed functions and other improvementsdrivers/watchdog/sbsa_gwdt.c+2 -190 replies
12/22watchdog: zx2967_wdt: Convert to use device managed functions and other improvementsdrivers/watchdog/zx2967_wdt.c+13 -201 reply
13/22watchdog: stm32_iwdg: Convert to use device managed functions and other improvementsdrivers/watchdog/stm32_iwdg.c+31 -340 replies
14/22watchdog: ux500_wdt: Convert to use device managed functions and other improvementsdrivers/watchdog/ux500_wdt.c+5 -120 replies
15/22watchdog: pic32-dmt: Convert to use device managed functions and other improvementsdrivers/watchdog/pic32-dmt.c+19 -270 replies
16/22watchdog: pic32-wdt: Convert to use device managed functions and other improvementsdrivers/watchdog/pic32-wdt.c+24 -340 replies
17/22watchdog: loongson1_wdt: Convert to use device managed functions and other improvementsdrivers/watchdog/loongson1_wdt.c+21 -270 replies
18/22watchdog: mt7621_wdt: Use 'dev' instead of dereferencing it repeatedlydrivers/watchdog/mt7621_wdt.c+4 -34 replies
19/22watchdog: rt2880_wdt: Convert to use device managed functions and other improvementsdrivers/watchdog/rt2880_wdt.c+8 -200 replies
20/22watchdog: jz4740_wdt: Use 'dev' instead of dereferencing it repeatedlydrivers/watchdog/jz4740_wdt.c+6 -72 replies
21/22watchdog: mpc8xxx_wdt: Convert to use device managed functions and other improvementsdrivers/watchdog/mpc8xxx_wdt.c+3 -141 reply
22/22watchdog: pnx4008_wdt: Convert to use device managed functions and other improvementsdrivers/watchdog/pnx4008_wdt.c+17 -210 replies

Reviews trailers per patch

3 of 22 patches have a Reviewed-by or Acked-by.

PatchShawn GuoChristophe Leroy
1/22
2/22
3/22
4/22
5/22
6/22
7/22
8/22
9/22
10/22A-b
11/22
12/22A-b
13/22
14/22
15/22
16/22
17/22
18/22
19/22
20/22
21/22R-b
22/22

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/22] watchdog: Expand use of device managed functions (series 3 of 3)

Use device managed functions and other changes to simplify error handling, reduce source code size, improve readability, and reduce the likelyhood of bugs.

The changes made in this series can be summarized to

- Use devm_add_action_or_reset() for calls to clk_disable_unprepare
- Use devm_watchdog_register_driver() to register watchdog device
- Replace 'of_clk_get(np, 0)' with 'devm_clk_get(dev, NULL)'
- Drop assignments to otherwise unused variables
- Drop unnecessary braces around conditional return statements
- Drop empty remove functions
- Replace shutdown function with call to watchdog_stop_on_reboot()
- Replace stop on remove with call to watchdog_stop_on_unregister()
- Replace 'goto l; ... l: return e;' with 'return e;'
- Replace 'ret = e; return ret;' with 'return e;'.
- Use local variable 'struct device *dev' consistently
- Introduce local variable 'struct device *dev' and use it instead of dereferencing it repeatedly
- Drop unnecessary calls to platform_set_drvdata()

Conversions were performed automatically with coccinelle using a number of semantic patches. The semantic patches and the scripts used to generate commit logs are available at https://github.com/groeck/coccinelle-patches.
All patches were compile tested and manually reviewed.

This is the third of three series of similar patches for watchdog drivers. More patches may follow over time.