Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

watchdog: wm831x_wdt: Remove GPIO handling

An attempt to convert the driver to using GPIO descriptors
(see Link tag) was discouraged in favor of deleting the
handling of the update GPIO altogehter since there are
no in-tree users.

This patch deletes the GPIO handling instead.

Cc: Richard Fitzgerald <rf@opensource.cirrus.com>
Cc: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/linux-watchdog/20200210102209.289379-1-linus.walleij@linaro.org/
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200229115046.57781-1-linus.walleij@linaro.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>

authored by

Linus Walleij and committed by
Wim Van Sebroeck
3f9d5133 dca96e01

-28
-27
drivers/watchdog/wm831x_wdt.c
··· 13 13 #include <linux/platform_device.h> 14 14 #include <linux/watchdog.h> 15 15 #include <linux/uaccess.h> 16 - #include <linux/gpio.h> 17 16 18 17 #include <linux/mfd/wm831x/core.h> 19 18 #include <linux/mfd/wm831x/pdata.h> ··· 28 29 struct watchdog_device wdt; 29 30 struct wm831x *wm831x; 30 31 struct mutex lock; 31 - int update_gpio; 32 32 int update_state; 33 33 }; 34 34 ··· 100 102 u16 reg; 101 103 102 104 mutex_lock(&driver_data->lock); 103 - 104 - if (driver_data->update_gpio) { 105 - gpio_set_value_cansleep(driver_data->update_gpio, 106 - driver_data->update_state); 107 - driver_data->update_state = !driver_data->update_state; 108 - ret = 0; 109 - goto out; 110 - } 111 105 112 106 reg = wm831x_reg_read(wm831x, WM831X_WATCHDOG); 113 107 ··· 228 238 reg |= pdata->primary << WM831X_WDOG_PRIMACT_SHIFT; 229 239 reg |= pdata->secondary << WM831X_WDOG_SECACT_SHIFT; 230 240 reg |= pdata->software << WM831X_WDOG_RST_SRC_SHIFT; 231 - 232 - if (pdata->update_gpio) { 233 - ret = devm_gpio_request_one(dev, pdata->update_gpio, 234 - GPIOF_OUT_INIT_LOW, 235 - "Watchdog update"); 236 - if (ret < 0) { 237 - dev_err(wm831x->dev, 238 - "Failed to request update GPIO: %d\n", 239 - ret); 240 - return ret; 241 - } 242 - 243 - driver_data->update_gpio = pdata->update_gpio; 244 - 245 - /* Make sure the watchdog takes hardware updates */ 246 - reg |= WM831X_WDOG_RST_SRC; 247 - } 248 241 249 242 ret = wm831x_reg_unlock(wm831x); 250 243 if (ret == 0) {
-1
include/linux/mfd/wm831x/pdata.h
··· 89 89 90 90 struct wm831x_watchdog_pdata { 91 91 enum wm831x_watchdog_action primary, secondary; 92 - int update_gpio; 93 92 unsigned int software:1; 94 93 }; 95 94