diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-11-29 12:00:19 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-12-04 00:25:06 -0500 |
commit | 333e34bfe2149e634fb0613b4936fd838c36fafb (patch) | |
tree | c8de3cc15d1b6245edc977085253b71f861f895d /drivers/input/keyboard/gpio_keys.c | |
parent | 1a22e16fc3d6abc8d6323cc0973435439932fe5f (diff) |
Input: gpio_keys - switch to using gpio_request_one()
This saves us a few lines of code.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/keyboard/gpio_keys.c')
-rw-r--r-- | drivers/input/keyboard/gpio_keys.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 79435de0caa8..d327f5a2bb0e 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c | |||
@@ -440,21 +440,13 @@ static int gpio_keys_setup_key(struct platform_device *pdev, | |||
440 | 440 | ||
441 | if (gpio_is_valid(button->gpio)) { | 441 | if (gpio_is_valid(button->gpio)) { |
442 | 442 | ||
443 | error = gpio_request(button->gpio, desc); | 443 | error = gpio_request_one(button->gpio, GPIOF_IN, desc); |
444 | if (error < 0) { | 444 | if (error < 0) { |
445 | dev_err(dev, "Failed to request GPIO %d, error %d\n", | 445 | dev_err(dev, "Failed to request GPIO %d, error %d\n", |
446 | button->gpio, error); | 446 | button->gpio, error); |
447 | return error; | 447 | return error; |
448 | } | 448 | } |
449 | 449 | ||
450 | error = gpio_direction_input(button->gpio); | ||
451 | if (error < 0) { | ||
452 | dev_err(dev, | ||
453 | "Failed to configure direction for GPIO %d, error %d\n", | ||
454 | button->gpio, error); | ||
455 | goto fail; | ||
456 | } | ||
457 | |||
458 | if (button->debounce_interval) { | 450 | if (button->debounce_interval) { |
459 | error = gpio_set_debounce(button->gpio, | 451 | error = gpio_set_debounce(button->gpio, |
460 | button->debounce_interval * 1000); | 452 | button->debounce_interval * 1000); |