All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/bridge: use flags argument of devm_gpiod_get to set direction
@ 2015-05-19  7:03 Uwe Kleine-König
  2015-05-19  7:09 ` Uwe Kleine-König
  2015-05-19  8:06 ` Thierry Reding
  0 siblings, 2 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2015-05-19  7:03 UTC (permalink / raw)
  To: David Airlie, Thierry Reding
  Cc: Alexandre Courbot, Vincent Palatin, dri-devel, kernel

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.

Use this to simplify the driver. Furthermore this is one caller less
that stops us making the flags argument to gpiod_get*() mandatory.

Fixes: b2ea8772799d ("drm/bridge: Add I2C based driver for ps8622/ps8625 bridge")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/gpu/drm/bridge/ps8622.c | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/bridge/ps8622.c b/drivers/gpu/drm/bridge/ps8622.c
index e895aa7ea353..9534607cbd10 100644
--- a/drivers/gpu/drm/bridge/ps8622.c
+++ b/drivers/gpu/drm/bridge/ps8622.c
@@ -581,31 +581,21 @@ static int ps8622_probe(struct i2c_client *client,
 		ps8622->v12 = NULL;
 	}
 
-	ps8622->gpio_slp = devm_gpiod_get(dev, "sleep");
+	ps8622->gpio_slp = devm_gpiod_get(dev, "sleep", GPIOD_OUT_HIGH);
 	if (IS_ERR(ps8622->gpio_slp)) {
 		ret = PTR_ERR(ps8622->gpio_slp);
 		dev_err(dev, "cannot get gpio_slp %d\n", ret);
 		return ret;
 	}
-	ret = gpiod_direction_output(ps8622->gpio_slp, 1);
-	if (ret) {
-		dev_err(dev, "cannot configure gpio_slp\n");
-		return ret;
-	}
 
-	ps8622->gpio_rst = devm_gpiod_get(dev, "reset");
-	if (IS_ERR(ps8622->gpio_rst)) {
-		ret = PTR_ERR(ps8622->gpio_rst);
-		dev_err(dev, "cannot get gpio_rst %d\n", ret);
-		return ret;
-	}
 	/*
 	 * Assert the reset pin high to avoid the bridge being
 	 * initialized prematurely
 	 */
-	ret = gpiod_direction_output(ps8622->gpio_rst, 1);
-	if (ret) {
-		dev_err(dev, "cannot configure gpio_rst\n");
+	ps8622->gpio_rst = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
+	if (IS_ERR(ps8622->gpio_rst)) {
+		ret = PTR_ERR(ps8622->gpio_rst);
+		dev_err(dev, "cannot get gpio_rst %d\n", ret);
 		return ret;
 	}
 
-- 
2.1.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/bridge: use flags argument of devm_gpiod_get to set direction
  2015-05-19  7:03 [PATCH] drm/bridge: use flags argument of devm_gpiod_get to set direction Uwe Kleine-König
@ 2015-05-19  7:09 ` Uwe Kleine-König
  2015-05-19  8:05   ` Thierry Reding
  2015-05-19  8:06 ` Thierry Reding
  1 sibling, 1 reply; 5+ messages in thread
From: Uwe Kleine-König @ 2015-05-19  7:09 UTC (permalink / raw)
  To: David Airlie, Thierry Reding
  Cc: Alexandre Courbot, Vincent Palatin, dri-devel, kernel

Hello,

the subject is missing "ps8622" before the :. Should I resend for that?

On Tue, May 19, 2015 at 09:03:49AM +0200, Uwe Kleine-König wrote:
>  drivers/gpu/drm/bridge/ps8622.c | 20 +++++---------------
>  1 file changed, 5 insertions(+), 15 deletions(-)

Best regards
Uwe


-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/bridge: use flags argument of devm_gpiod_get to set direction
  2015-05-19  7:09 ` Uwe Kleine-König
@ 2015-05-19  8:05   ` Thierry Reding
  0 siblings, 0 replies; 5+ messages in thread
From: Thierry Reding @ 2015-05-19  8:05 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Alexandre Courbot, Vincent Palatin, dri-devel, kernel


[-- Attachment #1.1: Type: text/plain, Size: 223 bytes --]

On Tue, May 19, 2015 at 09:09:24AM +0200, Uwe Kleine-König wrote:
> Hello,
> 
> the subject is missing "ps8622" before the :. Should I resend for that?

No need to resend, I've fixed it up while applying.

Thierry

[-- Attachment #1.2: Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/bridge: use flags argument of devm_gpiod_get to set direction
  2015-05-19  7:03 [PATCH] drm/bridge: use flags argument of devm_gpiod_get to set direction Uwe Kleine-König
  2015-05-19  7:09 ` Uwe Kleine-König
@ 2015-05-19  8:06 ` Thierry Reding
  2015-05-19  8:25   ` Uwe Kleine-König
  1 sibling, 1 reply; 5+ messages in thread
From: Thierry Reding @ 2015-05-19  8:06 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Alexandre Courbot, Vincent Palatin, dri-devel, kernel


[-- Attachment #1.1: Type: text/plain, Size: 822 bytes --]

On Tue, May 19, 2015 at 09:03:49AM +0200, 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.
> 
> Use this to simplify the driver. Furthermore this is one caller less
> that stops us making the flags argument to gpiod_get*() mandatory.
> 
> Fixes: b2ea8772799d ("drm/bridge: Add I2C based driver for ps8622/ps8625 bridge")

There's no need for this. The patch refactors code, but it doesn't fix
anything. Including a "Fixes:" line will cause people to pick this up
for stable releases, which I don't think is warranted in this case.

I've applied the patch with the "Fixes:" line removed.

Thanks,
Thierry

[-- Attachment #1.2: Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/bridge: use flags argument of devm_gpiod_get to set direction
  2015-05-19  8:06 ` Thierry Reding
@ 2015-05-19  8:25   ` Uwe Kleine-König
  0 siblings, 0 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2015-05-19  8:25 UTC (permalink / raw)
  To: Thierry Reding; +Cc: Alexandre Courbot, Vincent Palatin, dri-devel, kernel

Hello,

On Tue, May 19, 2015 at 10:06:54AM +0200, Thierry Reding wrote:
> On Tue, May 19, 2015 at 09:03:49AM +0200, 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.
> > 
> > Use this to simplify the driver. Furthermore this is one caller less
> > that stops us making the flags argument to gpiod_get*() mandatory.
> > 
> > Fixes: b2ea8772799d ("drm/bridge: Add I2C based driver for ps8622/ps8625 bridge")
> 
> There's no need for this. The patch refactors code, but it doesn't fix
> anything. Including a "Fixes:" line will cause people to pick this up
> for stable releases, which I don't think is warranted in this case.
> 
> I've applied the patch with the "Fixes:" line removed.
I added the line because at some near point in time I want to make the
flags argument mandatory and then it's a bug to not pass it. Do the
stable guys really pick patches that have Fixes: but not Cc: stable?

But I don't feel strong here. If you pick the patch up, everything
should be fine.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2015-05-19  8:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-19  7:03 [PATCH] drm/bridge: use flags argument of devm_gpiod_get to set direction Uwe Kleine-König
2015-05-19  7:09 ` Uwe Kleine-König
2015-05-19  8:05   ` Thierry Reding
2015-05-19  8:06 ` Thierry Reding
2015-05-19  8:25   ` 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.