All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: light: stk3310: use flags argument of devm_gpiod_get
@ 2015-06-12  7:51 Uwe Kleine-König
  2015-06-13 18:06 ` Jonathan Cameron
  2015-06-15  8:16 ` Linus Walleij
  0 siblings, 2 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2015-06-12  7:51 UTC (permalink / raw)
  To: Tiberiu Breana, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald
  Cc: kernel, Alexandre Courbot, Linus Walleij, linux-iio

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.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hello,

this patch applies to next and is only necessary on top of 3dd477acbdd1
(iio: light: Add threshold interrupt support for STK3310) which
currently sits in next.

Note I plan to make the flags parameter mandatory for 4.3. So unless
this change gets into 4.2, would it be ok to let it go in via the gpio
tree?

Best regards
Uwe

 drivers/iio/light/stk3310.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c
index e79b9d89b024..504d1e9b4c02 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);
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] iio: light: stk3310: use flags argument of devm_gpiod_get
  2015-06-12  7:51 [PATCH] iio: light: stk3310: use flags argument of devm_gpiod_get Uwe Kleine-König
@ 2015-06-13 18:06 ` Jonathan Cameron
  2015-06-13 19:11   ` Uwe Kleine-König
  2015-06-15  8:16 ` Linus Walleij
  1 sibling, 1 reply; 6+ messages in thread
From: Jonathan Cameron @ 2015-06-13 18:06 UTC (permalink / raw)
  To: Uwe Kleine-König, Tiberiu Breana, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald
  Cc: kernel, Alexandre Courbot, Linus Walleij, linux-iio

On 12/06/15 08:51, Uwe Kleine-König wrote:
> 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.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
> ---
> Hello,
> 
> this patch applies to next and is only necessary on top of 3dd477acbdd1
> (iio: light: Add threshold interrupt support for STK3310) which
> currently sits in next.
> 
> Note I plan to make the flags parameter mandatory for 4.3. So unless
> this change gets into 4.2, would it be ok to let it go in via the gpio
> tree?
yes, that's fine.

Thanks,

Jonathan
> 
> Best regards
> Uwe
> 
>  drivers/iio/light/stk3310.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c
> index e79b9d89b024..504d1e9b4c02 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);
>  
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] iio: light: stk3310: use flags argument of devm_gpiod_get
  2015-06-13 18:06 ` Jonathan Cameron
@ 2015-06-13 19:11   ` Uwe Kleine-König
  2015-06-13 20:47     ` Jonathan Cameron
  0 siblings, 1 reply; 6+ messages in thread
From: Uwe Kleine-König @ 2015-06-13 19:11 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Tiberiu Breana, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald, kernel, Alexandre Courbot, Linus Walleij,
	linux-iio

Hello Jonathan,

On Sat, Jun 13, 2015 at 07:06:29PM +0100, Jonathan Cameron wrote:
> On 12/06/15 08:51, Uwe Kleine-König wrote:
> > 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.
> > 
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Acked-by: Jonathan Cameron <jic23@kernel.org>
> > ---
> > Hello,
> > 
> > this patch applies to next and is only necessary on top of 3dd477acbdd1
> > (iio: light: Add threshold interrupt support for STK3310) which
> > currently sits in next.
> > 
> > Note I plan to make the flags parameter mandatory for 4.3. So unless
> > this change gets into 4.2, would it be ok to let it go in via the gpio
> > tree?
> yes, that's fine.
that means you won't take it for 4.2, right?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] iio: light: stk3310: use flags argument of devm_gpiod_get
  2015-06-13 19:11   ` Uwe Kleine-König
@ 2015-06-13 20:47     ` Jonathan Cameron
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2015-06-13 20:47 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Tiberiu Breana, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald, kernel, Alexandre Courbot, Linus Walleij,
	linux-iio

On 13/06/15 20:11, Uwe Kleine-König wrote:
> Hello Jonathan,
> 
> On Sat, Jun 13, 2015 at 07:06:29PM +0100, Jonathan Cameron wrote:
>> On 12/06/15 08:51, Uwe Kleine-König wrote:
>>> 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.
>>>
>>> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>> Acked-by: Jonathan Cameron <jic23@kernel.org>
>>> ---
>>> Hello,
>>>
>>> this patch applies to next and is only necessary on top of 3dd477acbdd1
>>> (iio: light: Add threshold interrupt support for STK3310) which
>>> currently sits in next.
>>>
>>> Note I plan to make the flags parameter mandatory for 4.3. So unless
>>> this change gets into 4.2, would it be ok to let it go in via the gpio
>>> tree?
>> yes, that's fine.
> that means you won't take it for 4.2, right?
> 
Indeed, too late for us this cycle.
> Best regards
> Uwe
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] iio: light: stk3310: use flags argument of devm_gpiod_get
  2015-06-12  7:51 [PATCH] iio: light: stk3310: use flags argument of devm_gpiod_get Uwe Kleine-König
  2015-06-13 18:06 ` Jonathan Cameron
@ 2015-06-15  8:16 ` Linus Walleij
  2015-06-15  8:35   ` Uwe Kleine-König
  1 sibling, 1 reply; 6+ messages in thread
From: Linus Walleij @ 2015-06-15  8:16 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Tiberiu Breana, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald, Sascha Hauer,
	Alexandre Courbot, linux-iio

On Fri, Jun 12, 2015 at 9:51 AM, Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:

> Note I plan to make the flags parameter mandatory for 4.3. So unless
> this change gets into 4.2, would it be ok to let it go in via the gpio
> tree?

Sounds like a plan. If you will have a patch set with the remaining
consumers fixed and then remove the non-flagged functions
on top, let's merge that into the GPIO tree for linux-next right after
the 4.2 merge window so we can terminate this task.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] iio: light: stk3310: use flags argument of devm_gpiod_get
  2015-06-15  8:16 ` Linus Walleij
@ 2015-06-15  8:35   ` Uwe Kleine-König
  0 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2015-06-15  8:35 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Tiberiu Breana, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald, Sascha Hauer,
	Alexandre Courbot, linux-iio

Hi Linus,

On Mon, Jun 15, 2015 at 10:16:46AM +0200, Linus Walleij wrote:
> On Fri, Jun 12, 2015 at 9:51 AM, Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
> 
> > Note I plan to make the flags parameter mandatory for 4.3. So unless
> > this change gets into 4.2, would it be ok to let it go in via the gpio
> > tree?
> 
> Sounds like a plan. If you will have a patch set with the remaining
> consumers fixed and then remove the non-flagged functions
> on top, let's merge that into the GPIO tree for linux-next right after
> the 4.2 merge window so we can terminate this task.
That's exactly my plan.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-06-15  8:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-12  7:51 [PATCH] iio: light: stk3310: use flags argument of devm_gpiod_get Uwe Kleine-König
2015-06-13 18:06 ` Jonathan Cameron
2015-06-13 19:11   ` Uwe Kleine-König
2015-06-13 20:47     ` Jonathan Cameron
2015-06-15  8:16 ` Linus Walleij
2015-06-15  8:35   ` Uwe Kleine-König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.