Commit 7d891dbe authored by Uwe Kleine-König's avatar Uwe Kleine-König

iio: magn: bmc150: use flags argument of devm_gpiod_get

Since 39b2bbe3 (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: default avatarJonathan Cameron <jic23@kernel.org>
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
parent 7d4eb6f2
...@@ -839,16 +839,12 @@ static int bmc150_magn_gpio_probe(struct i2c_client *client) ...@@ -839,16 +839,12 @@ static int bmc150_magn_gpio_probe(struct i2c_client *client)
dev = &client->dev; dev = &client->dev;
/* data ready GPIO interrupt pin */ /* data ready GPIO interrupt pin */
gpio = devm_gpiod_get_index(dev, BMC150_MAGN_GPIO_INT, 0); gpio = devm_gpiod_get_index(dev, BMC150_MAGN_GPIO_INT, 0, GPIOD_IN);
if (IS_ERR(gpio)) { if (IS_ERR(gpio)) {
dev_err(dev, "ACPI GPIO get index failed\n"); dev_err(dev, "ACPI GPIO get index failed\n");
return PTR_ERR(gpio); return PTR_ERR(gpio);
} }
ret = gpiod_direction_input(gpio);
if (ret)
return ret;
ret = gpiod_to_irq(gpio); ret = gpiod_to_irq(gpio);
dev_dbg(dev, "GPIO resource, no:%d irq:%d\n", desc_to_gpio(gpio), ret); dev_dbg(dev, "GPIO resource, no:%d irq:%d\n", desc_to_gpio(gpio), ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment