Commit 333e34bf authored by Dmitry Torokhov's avatar Dmitry Torokhov

Input: gpio_keys - switch to using gpio_request_one()

This saves us a few lines of code.
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 1a22e16f
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment