staging:iio:magnetometer:ak8975: use gpio_request_one api
authorLeed Aguilar <leed.aguilar@ti.com>
Wed, 6 Jun 2012 20:15:40 +0000 (16:15 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 7 Jun 2012 05:32:59 +0000 (14:32 +0900)
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>
drivers/staging/iio/magnetometer/Kconfig
drivers/staging/iio/magnetometer/ak8975.c

index b9d932595ba95954694123acccd9f8c0fff980ec..df5e0d4ea29566b22171f8026ec09d6800a2f835 100644 (file)
@@ -6,7 +6,7 @@ menu "Magnetometer sensors"
 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.
index 001b3bff4765f70aed62d57ffbd5b2b8d5a7dcb2..11bde3fd93b5e2d182e10755e466909faa69ce25 100644 (file)
@@ -499,21 +499,13 @@ static int __devinit ak8975_probe(struct i2c_client *client,
        /* 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 */