Input: gpio_keys_polled - switch to using gpio_request_one()
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 29 Nov 2012 17:24:08 +0000 (09:24 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 4 Dec 2012 05:25:11 +0000 (21:25 -0800)
This saves us a few lines of code.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/keyboard/gpio_keys_polled.c

index d72d0e5ebb85467b10d6eab9b16ba04b50ae2573..f686fd970553afb12b7d829fa6756c60c5598ee4 100644 (file)
@@ -270,22 +270,14 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)
                        goto err_free_gpio;
                }
 
-               error = gpio_request(gpio,
-                                    button->desc ? button->desc : DRV_NAME);
+               error = gpio_request_one(gpio, GPIOF_IN,
+                                        button->desc ?: DRV_NAME);
                if (error) {
                        dev_err(dev, "unable to claim gpio %u, err=%d\n",
                                gpio, error);
                        goto err_free_gpio;
                }
 
-               error = gpio_direction_input(gpio);
-               if (error) {
-                       dev_err(dev,
-                               "unable to set direction on gpio %u, err=%d\n",
-                               gpio, error);
-                       goto err_free_gpio;
-               }
-
                bdata->can_sleep = gpio_cansleep(gpio);
                bdata->last_state = -1;
                bdata->threshold = DIV_ROUND_UP(button->debounce_interval,