From: Dmitry Torokhov Date: Thu, 29 Nov 2012 17:00:19 +0000 (-0800) Subject: Input: gpio_keys - switch to using gpio_request_one() X-Git-Tag: next-20121205~70^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=333e34bfe2149e634fb0613b4936fd838c36fafb;p=karo-tx-linux.git Input: gpio_keys - switch to using gpio_request_one() This saves us a few lines of code. Signed-off-by: Dmitry Torokhov --- 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, 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);