From b457f53a2afa7de3cecdec1772fbd522b98afc49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Wed, 18 Feb 2015 13:47:11 +0100 Subject: iio: improve usage of gpiod API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions) which appeared in v3.17-rc1, the gpiod_get* functions take an additional parameter that allows to specify direction and initial value for outputs. Signed-off-by: Uwe Kleine-König Reviewed-by: Linus Walleij Reviewed-by: Alexandre Courbot Reviewed-by: Daniel Baluta Signed-off-by: Jonathan Cameron --- drivers/iio/accel/mma9551.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'drivers/iio/accel/mma9551.c') diff --git a/drivers/iio/accel/mma9551.c b/drivers/iio/accel/mma9551.c index 46c38351c6a3..1277f407cd12 100644 --- a/drivers/iio/accel/mma9551.c +++ b/drivers/iio/accel/mma9551.c @@ -418,16 +418,13 @@ static int mma9551_gpio_probe(struct iio_dev *indio_dev) struct device *dev = &data->client->dev; for (i = 0; i < MMA9551_GPIO_COUNT; i++) { - gpio = devm_gpiod_get_index(dev, MMA9551_GPIO_NAME, i); + gpio = devm_gpiod_get_index(dev, MMA9551_GPIO_NAME, i, + GPIOD_IN); if (IS_ERR(gpio)) { dev_err(dev, "acpi gpio get index failed\n"); return PTR_ERR(gpio); } - ret = gpiod_direction_input(gpio); - if (ret) - return ret; - data->irqs[i] = gpiod_to_irq(gpio); ret = devm_request_threaded_irq(dev, data->irqs[i], NULL, mma9551_event_handler, -- cgit v1.2.1