* [PATCH v2] staging:iio:magnetometer:ak8975: use gpio_request_one api
@ 2012-05-31 13:17 Leed Aguilar
2012-06-01 8:01 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Leed Aguilar @ 2012-05-31 13:17 UTC (permalink / raw)
To: linux-iio; +Cc: Leed Aguilar, Jonathan Cameron
Use gpio_request_one api, it looks cleaner.
Signed-off-by: Leed Aguilar <leed.aguilar@ti.com>
Cc: Jonathan Cameron <jic23@kernel.org>
---
drivers/staging/iio/magnetometer/ak8975.c | 10 +---------
1 files changed, 1 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/iio/magnetometer/ak8975.c b/drivers/staging/iio/magnetometer/ak8975.c
index ebc2d08..52833cd 100644
--- a/drivers/staging/iio/magnetometer/ak8975.c
+++ b/drivers/staging/iio/magnetometer/ak8975.c
@@ -487,21 +487,13 @@ static int 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 */
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] staging:iio:magnetometer:ak8975: use gpio_request_one api
2012-05-31 13:17 [PATCH v2] staging:iio:magnetometer:ak8975: use gpio_request_one api Leed Aguilar
@ 2012-06-01 8:01 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2012-06-01 8:01 UTC (permalink / raw)
To: Leed Aguilar; +Cc: linux-iio
On 5/31/2012 2:17 PM, Leed Aguilar wrote:
> Use gpio_request_one api, it looks cleaner.
But adds a dependency on GPIOLIB. I'm not that bothered by
that but it needs to be explicit in the Kconfig.
>
> Signed-off-by: Leed Aguilar<leed.aguilar@ti.com>
> Cc: Jonathan Cameron<jic23@kernel.org>
> ---
> drivers/staging/iio/magnetometer/ak8975.c | 10 +---------
> 1 files changed, 1 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/staging/iio/magnetometer/ak8975.c b/drivers/staging/iio/magnetometer/ak8975.c
> index ebc2d08..52833cd 100644
> --- a/drivers/staging/iio/magnetometer/ak8975.c
> +++ b/drivers/staging/iio/magnetometer/ak8975.c
> @@ -487,21 +487,13 @@ static int 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 */
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-06-01 8:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-31 13:17 [PATCH v2] staging:iio:magnetometer:ak8975: use gpio_request_one api Leed Aguilar
2012-06-01 8:01 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).