diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2017-04-03 21:01:20 +0200 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2017-04-03 21:01:20 +0200 |
commit | 03b22057e8ed2d1df416c9ae8e6e247e0b87ecc8 (patch) | |
tree | cd89bdd4053e46ff3cbd67adeffa24310c04e725 /drivers/input/keyboard | |
parent | Input: silead - list all supported compatible strings in binding document (diff) | |
parent | Linux 4.11-rc5 (diff) | |
download | linux-03b22057e8ed2d1df416c9ae8e6e247e0b87ecc8.tar.xz linux-03b22057e8ed2d1df416c9ae8e6e247e0b87ecc8.zip |
Merge tag 'v4.11-rc5' into next
Sync up with mainline to bring in changes to input subsystem merged
through other trees.
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r-- | drivers/input/keyboard/gpio_keys.c | 12 | ||||
-rw-r--r-- | drivers/input/keyboard/gpio_keys_polled.c | 14 |
2 files changed, 8 insertions, 18 deletions
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 9c92cdf196e3..da3d362f21b1 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -485,7 +485,10 @@ static int gpio_keys_setup_key(struct platform_device *pdev, spin_lock_init(&bdata->lock); if (child) { - bdata->gpiod = devm_get_gpiod_from_child(dev, NULL, child); + bdata->gpiod = devm_fwnode_get_gpiod_from_child(dev, NULL, + child, + GPIOD_IN, + desc); if (IS_ERR(bdata->gpiod)) { error = PTR_ERR(bdata->gpiod); if (error == -ENOENT) { @@ -500,13 +503,6 @@ static int gpio_keys_setup_key(struct platform_device *pdev, error); return error; } - } else { - 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); - return error; - } } } else if (gpio_is_valid(button->gpio)) { /* diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c index 4fce43a6a0e0..edc7262103b9 100644 --- a/drivers/input/keyboard/gpio_keys_polled.c +++ b/drivers/input/keyboard/gpio_keys_polled.c @@ -303,8 +303,10 @@ static int gpio_keys_polled_probe(struct platform_device *pdev) return -EINVAL; } - bdata->gpiod = devm_get_gpiod_from_child(dev, NULL, - child); + bdata->gpiod = devm_fwnode_get_gpiod_from_child(dev, + NULL, child, + GPIOD_IN, + button->desc); if (IS_ERR(bdata->gpiod)) { error = PTR_ERR(bdata->gpiod); if (error != -EPROBE_DEFER) @@ -314,14 +316,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 |