summaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard
diff options
context:
space:
mode:
authorUwe Kleine-König2015-06-17 02:02:13 +0200
committerDmitry Torokhov2015-06-17 02:09:14 +0200
commitea0afac450d2a3aaeb4c51ddf1631e677afe3193 (patch)
tree5b769eba94df0a9775c542bcb633ca221633aa0d /drivers/input/keyboard
parenttty/vt/keyboard: define LED triggers for VT keyboard lock states (diff)
downloadkernel-qcow2-linux-ea0afac450d2a3aaeb4c51ddf1631e677afe3193.tar.gz
kernel-qcow2-linux-ea0afac450d2a3aaeb4c51ddf1631e677afe3193.tar.xz
kernel-qcow2-linux-ea0afac450d2a3aaeb4c51ddf1631e677afe3193.zip
Input: improve usage of gpiod API
Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions) which appeared in v3.17-rc1, the gpiod_get* functions take an additional parameter that allows to specify direction and initial value for output. Simplify drivers accordingly. Note that in the case of the drv260x driver error checking is more strict now because -ENOSYS is reported to the caller now. But this should only be returned if GPIOLIB is disabled which shouldn't happen as the driver depends on GPIOLIB. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r--drivers/input/keyboard/clps711x-keypad.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/input/keyboard/clps711x-keypad.c b/drivers/input/keyboard/clps711x-keypad.c
index 27ef29f8fe6a..b637f1af842e 100644
--- a/drivers/input/keyboard/clps711x-keypad.c
+++ b/drivers/input/keyboard/clps711x-keypad.c
@@ -120,14 +120,9 @@ static int clps711x_keypad_probe(struct platform_device *pdev)
for (i = 0; i < priv->row_count; i++) {
struct clps711x_gpio_data *data = &priv->gpio_data[i];
- data->desc = devm_gpiod_get_index(dev, "row", i);
- if (!data->desc)
- return -EINVAL;
-
+ data->desc = devm_gpiod_get_index(dev, "row", i, GPIOD_IN);
if (IS_ERR(data->desc))
return PTR_ERR(data->desc);
-
- gpiod_direction_input(data->desc);
}
err = of_property_read_u32(np, "poll-interval", &poll_interval);