summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2015-06-12 09:04:55 +0200
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2015-07-06 10:10:21 +0200
commit7d4eb6f2110d9a9f9fe8d39eabddadbd35eb12b2 (patch)
tree3d3f213d8a08442894b596e6c366267308ccbde2 /drivers/iio
parent26a5bd26499fba331ecaa1e8ce8cc2b8c6fac569 (diff)
downloadop-kernel-dev-7d4eb6f2110d9a9f9fe8d39eabddadbd35eb12b2.zip
op-kernel-dev-7d4eb6f2110d9a9f9fe8d39eabddadbd35eb12b2.tar.gz
iio: light: stk3310: use flags argument of devm_gpiod_get
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 output. Simplify driver accordingly. Furthermore this is one caller less that stops us making the flags argument to gpiod_get*() mandatory. Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/light/stk3310.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c
index fee4297..84c77d4 100644
--- a/drivers/iio/light/stk3310.c
+++ b/drivers/iio/light/stk3310.c
@@ -488,16 +488,12 @@ static int stk3310_gpio_probe(struct i2c_client *client)
dev = &client->dev;
/* gpio interrupt pin */
- gpio = devm_gpiod_get_index(dev, STK3310_GPIO, 0);
+ gpio = devm_gpiod_get_index(dev, STK3310_GPIO, 0, 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;
-
ret = gpiod_to_irq(gpio);
dev_dbg(dev, "GPIO resource, no:%d irq:%d\n", desc_to_gpio(gpio), ret);
OpenPOWER on IntegriCloud