Skip to content

Commit

Permalink
Input: gpio_keys - 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 1a22e16 commit 333e34b
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions drivers/input/keyboard/gpio_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,21 +440,13 @@ static int gpio_keys_setup_key(struct platform_device *pdev,

if (gpio_is_valid(button->gpio)) {

error = gpio_request(button->gpio, desc);
error = gpio_request_one(button->gpio, GPIOF_IN, desc);
if (error < 0) {
dev_err(dev, "Failed to request GPIO %d, error %d\n",
button->gpio, error);
return error;
}

error = gpio_direction_input(button->gpio);
if (error < 0) {
dev_err(dev,
"Failed to configure direction for GPIO %d, error %d\n",
button->gpio, error);
goto fail;
}

if (button->debounce_interval) {
error = gpio_set_debounce(button->gpio,
button->debounce_interval * 1000);
Expand Down

0 comments on commit 333e34b

Please sign in to comment.