diff options
author | Leed Aguilar <leed.aguilar@ti.com> | 2012-06-06 16:15:40 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-07 14:32:59 +0900 |
commit | 82f2acdce16ad7f124b6bb38c10a1894aa534864 (patch) | |
tree | 730e1cc29d992d6d7b08eef1ba04f1c4ec664913 | |
parent | 040f3e5833b9426aaeead6da8957a9b87f3ca9e8 (diff) | |
download | op-kernel-dev-82f2acdce16ad7f124b6bb38c10a1894aa534864.zip op-kernel-dev-82f2acdce16ad7f124b6bb38c10a1894aa534864.tar.gz |
staging:iio:magnetometer:ak8975: use gpio_request_one api
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>
-rw-r--r-- | drivers/staging/iio/magnetometer/Kconfig | 2 | ||||
-rw-r--r-- | drivers/staging/iio/magnetometer/ak8975.c | 10 |
2 files changed, 2 insertions, 10 deletions
diff --git a/drivers/staging/iio/magnetometer/Kconfig b/drivers/staging/iio/magnetometer/Kconfig index b9d9325..df5e0d4 100644 --- a/drivers/staging/iio/magnetometer/Kconfig +++ b/drivers/staging/iio/magnetometer/Kconfig @@ -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. diff --git a/drivers/staging/iio/magnetometer/ak8975.c b/drivers/staging/iio/magnetometer/ak8975.c index 001b3bf..11bde3f 100644 --- a/drivers/staging/iio/magnetometer/ak8975.c +++ b/drivers/staging/iio/magnetometer/ak8975.c @@ -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 */ |