mbox series

[00/22] watchdog: Convert to use device managed functions and other improvements

Message ID 1554752326-13319-1-git-send-email-linux@roeck-us.net (mailing list archive)
Headers show
Series watchdog: Convert to use device managed functions and other improvements | expand

Message

Guenter Roeck April 8, 2019, 7:38 p.m. UTC
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 '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.

This is the first of (at least) three series of similar patches for watchdog
drivers.