watchdog: mena21_wdt: Convert to use device managed functions and other improvements
authorGuenter Roeck <linux@roeck-us.net>
Tue, 10 Jan 2017 23:21:52 +0000 (15:21 -0800)
committerGuenter Roeck <linux@roeck-us.net>
Fri, 24 Feb 2017 22:00:23 +0000 (14:00 -0800)
commitcb5c14ea573b625053487f9dfde395ac0e8bc11b
tree9f0cb30d8e4fcfac77984172c464cf94fb44e154
parent30cba9a109feb0dbb262d575ae33be8c16d7d26f
watchdog: mena21_wdt: Convert to use device managed functions and other improvements

Use device managed functions to simplify error handling, reduce
source code size, improve readability, and reduce the likelyhood of bugs.
Other improvements as listed below.

The conversion was done automatically with coccinelle using the
following semantic patches. The semantic patches and the scripts used
to generate this commit log are available at
https://github.com/groeck/coccinelle-patches

- Replace 'goto l; ... l: return e;' with 'return e;'
- Drop assignments to otherwise unused variables
- Drop remove function
- Drop unnecessary mutex_destroy() on allocated data
- Use devm_watchdog_register_driver() to register watchdog device

Acked-by: Johannes Thumshirn <morbidrsa@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/watchdog/mena21_wdt.c