Skip to content

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

Guenter Roeck linux-watchdog lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest23 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/23watchdog: max77620_wdt: Convert to use device managed functions and other improvementsdrivers/watchdog/max77620_wdt.c+7 -160 replies
2/23watchdog: mena21_wdt: Use 'dev' instead of dereferencing it repeatedlydrivers/watchdog/mena21_wdt.c+13 -151 reply
3/23watchdog: menf21bmc_wdt: Convert to use device managed functions and other improvementsdrivers/watchdog/menf21bmc_wdt.c+10 -230 replies
4/23watchdog: meson_gxbb_wdt: Convert to use device managed functions and other improvementsdrivers/watchdog/meson_gxbb_wdt.c+15 -300 replies
5/23watchdog: meson_wdt: Use 'dev' instead of dereferencing it repeatedlydrivers/watchdog/meson_wdt.c+8 -70 replies
6/23watchdog: mlx_wdt: Use 'dev' instead of dereferencing it repeatedlydrivers/watchdog/mlx_wdt.c+7 -70 replies
7/23watchdog: moxart_wdt: Convert to use device managed functions and other improvementsdrivers/watchdog/moxart_wdt.c+3 -130 replies
8/23watchdog: mtk_wdt: Convert to use device managed functions and other improvementsdrivers/watchdog/mtk_wdt.c+8 -250 replies
9/23watchdog: npcm_wdt: Use local variable 'dev' consistentlydrivers/watchdog/npcm_wdt.c+3 -30 replies
10/23watchdog: of_xilinx_wdt: Convert to use device managed functions and other improvementsdrivers/watchdog/of_xilinx_wdt.c+26 -322 replies
11/23watchdog: pm8916_wdt: Use 'dev' instead of dereferencing it repeatedlydrivers/watchdog/pm8916_wdt.c+11 -100 replies
12/23watchdog: qcom-wdt: Convert to use device managed functions and other improvementsdrivers/watchdog/qcom-wdt.c+25 -300 replies
13/23watchdog: rn5t618_wdt: Use 'dev' instead of dereferencing it repeatedlydrivers/watchdog/rn5t618_wdt.c+5 -40 replies
14/23watchdog: rtd119x_wdt: Convert to use device managed functions and other improvementsdrivers/watchdog/rtd119x_wdt.c+15 -270 replies
15/23watchdog: rza_wdt: Use 'dev' instead of dereferencing it repeatedlydrivers/watchdog/rza_wdt.c+11 -100 replies
16/23watchdog: sama5d4_wdt: Convert to use device managed functions and other improvementsdrivers/watchdog/sama5d4_wdt.c+12 -230 replies
17/23watchdog: sirfsoc_wdt: Convert to use device managed functions and other improvementsdrivers/watchdog/sirfsoc_wdt.c+6 -180 replies
18/23watchdog: 1: Convert to use device managed functions and other improvementsdrivers/watchdog/sprd_wdt.c+18 -201 reply
19/23watchdog: st_lpc_wdt: Convert to use device managed functionsdrivers/watchdog/st_lpc_wdt.c+26 -211 reply
20/23watchdog: stmp3xxx_rtc_wdt: Convert to use device managed functionsdrivers/watchdog/stmp3xxx_rtc_wdt.c+8 -80 replies
21/23watchdog: stpmic1_wdt: Use 'dev' instead of dereferencing it repeatedlydrivers/watchdog/stpmic1_wdt.c+7 -60 replies
22/23watchdog: sunxi_wdt: Use 'dev' instead of dereferencing it repeatedlydrivers/watchdog/sunxi_wdt.c+8 -71 reply
23/23watchdog: tangox_wdt: Convert to use device managed functions and other improvementsdrivers/watchdog/tangox_wdt.c+14 -234 replies

Reviews trailers per patch

5 of 23 patches have a Reviewed-by or Acked-by.

PatchMichal SimekMaxime RipardPatrice ChotardMans RullgardJohannes Thumshirn
1/23
2/23R-b
3/23
4/23
5/23
6/23
7/23
8/23
9/23
10/23A-b
11/23
12/23
13/23
14/23
15/23
16/23
17/23
18/23
19/23A-b
20/23
21/23
22/23A-b
23/23A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v1 thread

Cover letter [PATCH 00/23] watchdog: Expand use of device managed functions (series 2 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 function
- 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 second of (at least) three series of similar patches for watchdog drivers.