Skip to content

Commit

Permalink
Input: gpio_keys_polled - switch to using gpio_request_one()
Browse files Browse the repository at this point in the history
This saves us a few lines of code.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Dmitry Torokhov committed Dec 4, 2012
1 parent 333e34b commit da5ee07
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions drivers/input/keyboard/gpio_keys_polled.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,22 +270,14 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)
goto err_free_gpio;
}

error = gpio_request(gpio,
button->desc ? button->desc : DRV_NAME);
error = gpio_request_one(gpio, GPIOF_IN,
button->desc ?: DRV_NAME);
if (error) {
dev_err(dev, "unable to claim gpio %u, err=%d\n",
gpio, error);
goto err_free_gpio;
}

error = gpio_direction_input(gpio);
if (error) {
dev_err(dev,
"unable to set direction on gpio %u, err=%d\n",
gpio, error);
goto err_free_gpio;
}

bdata->can_sleep = gpio_cansleep(gpio);
bdata->last_state = -1;
bdata->threshold = DIV_ROUND_UP(button->debounce_interval,
Expand Down

0 comments on commit da5ee07

Please sign in to comment.