Skip to content

Commit

Permalink
watchdog: wm831x: Convert to gpio_request_one()
Browse files Browse the repository at this point in the history
Use the more modern API.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
  • Loading branch information
Mark Brown authored and Wim Van Sebroeck committed May 23, 2012
1 parent 690e7a7 commit abcf834
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions drivers/watchdog/wm831x_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,23 +247,16 @@ static int __devinit wm831x_wdt_probe(struct platform_device *pdev)
reg |= pdata->software << WM831X_WDOG_RST_SRC_SHIFT;

if (pdata->update_gpio) {
ret = gpio_request(pdata->update_gpio,
"Watchdog update");
ret = gpio_request_one(pdata->update_gpio,
GPIOF_DIR_OUT | GPIOF_INIT_LOW,
"Watchdog update");
if (ret < 0) {
dev_err(wm831x->dev,
"Failed to request update GPIO: %d\n",
ret);
goto err;
}

ret = gpio_direction_output(pdata->update_gpio, 0);
if (ret != 0) {
dev_err(wm831x->dev,
"gpio_direction_output returned: %d\n",
ret);
goto err_gpio;
}

driver_data->update_gpio = pdata->update_gpio;

/* Make sure the watchdog takes hardware updates */
Expand Down

0 comments on commit abcf834

Please sign in to comment.