Use gpio_request_one api, it looks cleaner.
Signed-off-by: Leed Aguilar <leed.aguilar@ti.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 config SENSORS_AK8975
        tristate "Asahi Kasei AK8975 3-Axis Magnetometer"
        depends on I2C
-       depends on GENERIC_GPIO
+       depends on GPIOLIB
        help
          Say yes here to build support for Asahi Kasei AK8975 3-Axis
          Magnetometer.
 
        /* We may not have a GPIO based IRQ to scan, that is fine, we will
           poll if so */
        if (gpio_is_valid(eoc_gpio)) {
-               err = gpio_request(eoc_gpio, "ak_8975");
+               err = gpio_request_one(eoc_gpio, GPIOF_IN, "ak_8975");
                if (err < 0) {
                        dev_err(&client->dev,
                                "failed to request GPIO %d, error %d\n",
                                                        eoc_gpio, err);
                        goto exit;
                }
-
-               err = gpio_direction_input(eoc_gpio);
-               if (err < 0) {
-                       dev_err(&client->dev,
-                               "Failed to configure input direction for GPIO %d, error %d\n",
-                                               eoc_gpio, err);
-                       goto exit_gpio;
-               }
        }
 
        /* Register with IIO */