aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard/gpio_keys_polled.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2017-01-09 16:02:28 +0200
committerLinus Walleij <linus.walleij@linaro.org>2017-01-26 09:59:32 +0100
commita264d10ff45c688293d9112fddd8d29c819e0853 (patch)
tree850a9dac5d81c8dfdd8bb4bcdc5247408ea59d9e /drivers/input/keyboard/gpio_keys_polled.c
parentLinux 4.10-rc1 (diff)
downloadlinux-dev-a264d10ff45c688293d9112fddd8d29c819e0853.tar.xz
linux-dev-a264d10ff45c688293d9112fddd8d29c819e0853.zip
gpiolib: Convert fwnode_get_named_gpiod() to configure GPIO
Make fwnode_get_named_gpiod() consistent with the rest of gpiod_get() like API, i.e. configure GPIO pin immediately after request. Besides obvious clean up it will help to configure pins based on firmware provided resources. Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/input/keyboard/gpio_keys_polled.c')
-rw-r--r--drivers/input/keyboard/gpio_keys_polled.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c
index bed4f2086158..fd7ab4dad87b 100644
--- a/drivers/input/keyboard/gpio_keys_polled.c
+++ b/drivers/input/keyboard/gpio_keys_polled.c
@@ -304,7 +304,8 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)
}
bdata->gpiod = devm_get_gpiod_from_child(dev, NULL,
- child);
+ child,
+ GPIOD_IN);
if (IS_ERR(bdata->gpiod)) {
error = PTR_ERR(bdata->gpiod);
if (error != -EPROBE_DEFER)
@@ -314,14 +315,6 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)
fwnode_handle_put(child);
return error;
}
-
- error = gpiod_direction_input(bdata->gpiod);
- if (error) {
- dev_err(dev, "Failed to configure GPIO %d as input: %d\n",
- desc_to_gpio(bdata->gpiod), error);
- fwnode_handle_put(child);
- return error;
- }
} else if (gpio_is_valid(button->gpio)) {
/*
* Legacy GPIO number so request the GPIO here and