All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pwm-backlight: use devm_gpiod_get_optional()
@ 2014-06-25  9:18 ` Alexandre Courbot
  0 siblings, 0 replies; 10+ messages in thread
From: Alexandre Courbot @ 2014-06-25  9:18 UTC (permalink / raw)
  To: Thierry Reding, Jingoo Han, Bryan Wu, Lee Jones
  Cc: linux-fbdev, linux-kernel, gnurou, Alexandre Courbot

Make use of the new devm_gpiod_get_optional() to simplify the probe
code.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
 drivers/video/backlight/pwm_bl.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index 38ca88bc5c3e..d1e0a7c6cac7 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -245,13 +245,10 @@ static int pwm_backlight_probe(struct platform_device *pdev)
 	pb->dev = &pdev->dev;
 	pb->enabled = false;
 
-	pb->enable_gpio = devm_gpiod_get(&pdev->dev, "enable");
+	pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable");
 	if (IS_ERR(pb->enable_gpio)) {
 		ret = PTR_ERR(pb->enable_gpio);
-		if (ret == -ENOENT)
-			pb->enable_gpio = NULL;
-		else
-			goto err_alloc;
+		goto err_alloc;
 	}
 
 	/*
-- 
2.0.0


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

* [PATCH] pwm-backlight: use devm_gpiod_get_optional()
@ 2014-06-25  9:18 ` Alexandre Courbot
  0 siblings, 0 replies; 10+ messages in thread
From: Alexandre Courbot @ 2014-06-25  9:18 UTC (permalink / raw)
  To: Thierry Reding, Jingoo Han, Bryan Wu, Lee Jones
  Cc: linux-fbdev, linux-kernel, gnurou, Alexandre Courbot

Make use of the new devm_gpiod_get_optional() to simplify the probe
code.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
 drivers/video/backlight/pwm_bl.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index 38ca88bc5c3e..d1e0a7c6cac7 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -245,13 +245,10 @@ static int pwm_backlight_probe(struct platform_device *pdev)
 	pb->dev = &pdev->dev;
 	pb->enabled = false;
 
-	pb->enable_gpio = devm_gpiod_get(&pdev->dev, "enable");
+	pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable");
 	if (IS_ERR(pb->enable_gpio)) {
 		ret = PTR_ERR(pb->enable_gpio);
-		if (ret = -ENOENT)
-			pb->enable_gpio = NULL;
-		else
-			goto err_alloc;
+		goto err_alloc;
 	}
 
 	/*
-- 
2.0.0


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

* Re: [PATCH] pwm-backlight: use devm_gpiod_get_optional()
  2014-06-25  9:18 ` Alexandre Courbot
@ 2014-06-25  9:54   ` Lee Jones
  -1 siblings, 0 replies; 10+ messages in thread
From: Lee Jones @ 2014-06-25  9:54 UTC (permalink / raw)
  To: Alexandre Courbot
  Cc: Thierry Reding, Jingoo Han, Bryan Wu, linux-fbdev, linux-kernel, gnurou

> Make use of the new devm_gpiod_get_optional() to simplify the probe
> code.
> 
> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
> ---
>  drivers/video/backlight/pwm_bl.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)

Looks good.  Applied, thanks.

> diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
> index 38ca88bc5c3e..d1e0a7c6cac7 100644
> --- a/drivers/video/backlight/pwm_bl.c
> +++ b/drivers/video/backlight/pwm_bl.c
> @@ -245,13 +245,10 @@ static int pwm_backlight_probe(struct platform_device *pdev)
>  	pb->dev = &pdev->dev;
>  	pb->enabled = false;
>  
> -	pb->enable_gpio = devm_gpiod_get(&pdev->dev, "enable");
> +	pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable");
>  	if (IS_ERR(pb->enable_gpio)) {
>  		ret = PTR_ERR(pb->enable_gpio);
> -		if (ret == -ENOENT)
> -			pb->enable_gpio = NULL;
> -		else
> -			goto err_alloc;
> +		goto err_alloc;
>  	}
>  
>  	/*

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH] pwm-backlight: use devm_gpiod_get_optional()
@ 2014-06-25  9:54   ` Lee Jones
  0 siblings, 0 replies; 10+ messages in thread
From: Lee Jones @ 2014-06-25  9:54 UTC (permalink / raw)
  To: Alexandre Courbot
  Cc: Thierry Reding, Jingoo Han, Bryan Wu, linux-fbdev, linux-kernel, gnurou

> Make use of the new devm_gpiod_get_optional() to simplify the probe
> code.
> 
> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
> ---
>  drivers/video/backlight/pwm_bl.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)

Looks good.  Applied, thanks.

> diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
> index 38ca88bc5c3e..d1e0a7c6cac7 100644
> --- a/drivers/video/backlight/pwm_bl.c
> +++ b/drivers/video/backlight/pwm_bl.c
> @@ -245,13 +245,10 @@ static int pwm_backlight_probe(struct platform_device *pdev)
>  	pb->dev = &pdev->dev;
>  	pb->enabled = false;
>  
> -	pb->enable_gpio = devm_gpiod_get(&pdev->dev, "enable");
> +	pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable");
>  	if (IS_ERR(pb->enable_gpio)) {
>  		ret = PTR_ERR(pb->enable_gpio);
> -		if (ret = -ENOENT)
> -			pb->enable_gpio = NULL;
> -		else
> -			goto err_alloc;
> +		goto err_alloc;
>  	}
>  
>  	/*

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH] pwm-backlight: use devm_gpiod_get_optional()
  2014-06-25  9:54   ` Lee Jones
@ 2014-06-25 11:13     ` Thierry Reding
  -1 siblings, 0 replies; 10+ messages in thread
From: Thierry Reding @ 2014-06-25 11:13 UTC (permalink / raw)
  To: Lee Jones
  Cc: Alexandre Courbot, Jingoo Han, Bryan Wu, linux-fbdev,
	linux-kernel, gnurou

[-- Attachment #1: Type: text/plain, Size: 631 bytes --]

On Wed, Jun 25, 2014 at 10:54:47AM +0100, Lee Jones wrote:
> > Make use of the new devm_gpiod_get_optional() to simplify the probe
> > code.
> > 
> > Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
> > ---
> >  drivers/video/backlight/pwm_bl.c | 7 ++-----
> >  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> Looks good.  Applied, thanks.

Technically pwm_bl.c is my turf. However I only adopted it way back when
the backlight subsystem was orphaned, but it seems Jingoo, Bryan and you
are taking good care of it these days, so perhaps it would be a good
idea to move it back to your custody?

Thierry

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

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

* Re: [PATCH] pwm-backlight: use devm_gpiod_get_optional()
@ 2014-06-25 11:13     ` Thierry Reding
  0 siblings, 0 replies; 10+ messages in thread
From: Thierry Reding @ 2014-06-25 11:13 UTC (permalink / raw)
  To: Lee Jones
  Cc: Alexandre Courbot, Jingoo Han, Bryan Wu, linux-fbdev,
	linux-kernel, gnurou

[-- Attachment #1: Type: text/plain, Size: 631 bytes --]

On Wed, Jun 25, 2014 at 10:54:47AM +0100, Lee Jones wrote:
> > Make use of the new devm_gpiod_get_optional() to simplify the probe
> > code.
> > 
> > Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
> > ---
> >  drivers/video/backlight/pwm_bl.c | 7 ++-----
> >  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> Looks good.  Applied, thanks.

Technically pwm_bl.c is my turf. However I only adopted it way back when
the backlight subsystem was orphaned, but it seems Jingoo, Bryan and you
are taking good care of it these days, so perhaps it would be a good
idea to move it back to your custody?

Thierry

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

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

* Re: [PATCH] pwm-backlight: use devm_gpiod_get_optional()
  2014-06-25 11:13     ` Thierry Reding
@ 2014-06-25 12:03       ` Lee Jones
  -1 siblings, 0 replies; 10+ messages in thread
From: Lee Jones @ 2014-06-25 12:03 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Alexandre Courbot, Jingoo Han, Bryan Wu, linux-fbdev,
	linux-kernel, gnurou

On Wed, 25 Jun 2014, Thierry Reding wrote:
> On Wed, Jun 25, 2014 at 10:54:47AM +0100, Lee Jones wrote:
> > > Make use of the new devm_gpiod_get_optional() to simplify the probe
> > > code.
> > > 
> > > Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
> > > ---
> > >  drivers/video/backlight/pwm_bl.c | 7 ++-----
> > >  1 file changed, 2 insertions(+), 5 deletions(-)
> > 
> > Looks good.  Applied, thanks.
> 
> Technically pwm_bl.c is my turf. However I only adopted it way back when
> the backlight subsystem was orphaned, but it seems Jingoo, Bryan and you
> are taking good care of it these days, so perhaps it would be a good
> idea to move it back to your custody?

Yeah, the whole 'driver maintainer' sketch could get pretty complex.
It's pretty clean-cut in the PWM subsystem as only one exists, but
Backlight and MFD have a whole bunch, and I don't usually wait for
them to Ack/Nack before applying or providing review comments.

I'm happy to play it however you like really.  I'm sure the boys and I
can handle it if you so wish.  Even better if you would say in the
MAINTAINERS file and provide review comments when patches are
submitted.  I do think all 'drivers/video/backlight' changes should go
in via the Backlight tree though.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH] pwm-backlight: use devm_gpiod_get_optional()
@ 2014-06-25 12:03       ` Lee Jones
  0 siblings, 0 replies; 10+ messages in thread
From: Lee Jones @ 2014-06-25 12:03 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Alexandre Courbot, Jingoo Han, Bryan Wu, linux-fbdev,
	linux-kernel, gnurou

On Wed, 25 Jun 2014, Thierry Reding wrote:
> On Wed, Jun 25, 2014 at 10:54:47AM +0100, Lee Jones wrote:
> > > Make use of the new devm_gpiod_get_optional() to simplify the probe
> > > code.
> > > 
> > > Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
> > > ---
> > >  drivers/video/backlight/pwm_bl.c | 7 ++-----
> > >  1 file changed, 2 insertions(+), 5 deletions(-)
> > 
> > Looks good.  Applied, thanks.
> 
> Technically pwm_bl.c is my turf. However I only adopted it way back when
> the backlight subsystem was orphaned, but it seems Jingoo, Bryan and you
> are taking good care of it these days, so perhaps it would be a good
> idea to move it back to your custody?

Yeah, the whole 'driver maintainer' sketch could get pretty complex.
It's pretty clean-cut in the PWM subsystem as only one exists, but
Backlight and MFD have a whole bunch, and I don't usually wait for
them to Ack/Nack before applying or providing review comments.

I'm happy to play it however you like really.  I'm sure the boys and I
can handle it if you so wish.  Even better if you would say in the
MAINTAINERS file and provide review comments when patches are
submitted.  I do think all 'drivers/video/backlight' changes should go
in via the Backlight tree though.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH] pwm-backlight: use devm_gpiod_get_optional()
  2014-06-25 12:03       ` Lee Jones
@ 2014-06-27  6:13         ` Thierry Reding
  -1 siblings, 0 replies; 10+ messages in thread
From: Thierry Reding @ 2014-06-27  6:13 UTC (permalink / raw)
  To: Lee Jones
  Cc: Alexandre Courbot, Jingoo Han, Bryan Wu, linux-fbdev,
	linux-kernel, gnurou

[-- Attachment #1: Type: text/plain, Size: 1431 bytes --]

On Wed, Jun 25, 2014 at 01:03:31PM +0100, Lee Jones wrote:
> On Wed, 25 Jun 2014, Thierry Reding wrote:
> > On Wed, Jun 25, 2014 at 10:54:47AM +0100, Lee Jones wrote:
> > > > Make use of the new devm_gpiod_get_optional() to simplify the probe
> > > > code.
> > > > 
> > > > Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
> > > > ---
> > > >  drivers/video/backlight/pwm_bl.c | 7 ++-----
> > > >  1 file changed, 2 insertions(+), 5 deletions(-)
> > > 
> > > Looks good.  Applied, thanks.
> > 
> > Technically pwm_bl.c is my turf. However I only adopted it way back when
> > the backlight subsystem was orphaned, but it seems Jingoo, Bryan and you
> > are taking good care of it these days, so perhaps it would be a good
> > idea to move it back to your custody?
> 
> Yeah, the whole 'driver maintainer' sketch could get pretty complex.
> It's pretty clean-cut in the PWM subsystem as only one exists, but
> Backlight and MFD have a whole bunch, and I don't usually wait for
> them to Ack/Nack before applying or providing review comments.
> 
> I'm happy to play it however you like really.  I'm sure the boys and I
> can handle it if you so wish.  Even better if you would say in the
> MAINTAINERS file and provide review comments when patches are
> submitted.  I do think all 'drivers/video/backlight' changes should go
> in via the Backlight tree though.

Okay, that works for me.

Thierry

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

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

* Re: [PATCH] pwm-backlight: use devm_gpiod_get_optional()
@ 2014-06-27  6:13         ` Thierry Reding
  0 siblings, 0 replies; 10+ messages in thread
From: Thierry Reding @ 2014-06-27  6:13 UTC (permalink / raw)
  To: Lee Jones
  Cc: Alexandre Courbot, Jingoo Han, Bryan Wu, linux-fbdev,
	linux-kernel, gnurou

[-- Attachment #1: Type: text/plain, Size: 1431 bytes --]

On Wed, Jun 25, 2014 at 01:03:31PM +0100, Lee Jones wrote:
> On Wed, 25 Jun 2014, Thierry Reding wrote:
> > On Wed, Jun 25, 2014 at 10:54:47AM +0100, Lee Jones wrote:
> > > > Make use of the new devm_gpiod_get_optional() to simplify the probe
> > > > code.
> > > > 
> > > > Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
> > > > ---
> > > >  drivers/video/backlight/pwm_bl.c | 7 ++-----
> > > >  1 file changed, 2 insertions(+), 5 deletions(-)
> > > 
> > > Looks good.  Applied, thanks.
> > 
> > Technically pwm_bl.c is my turf. However I only adopted it way back when
> > the backlight subsystem was orphaned, but it seems Jingoo, Bryan and you
> > are taking good care of it these days, so perhaps it would be a good
> > idea to move it back to your custody?
> 
> Yeah, the whole 'driver maintainer' sketch could get pretty complex.
> It's pretty clean-cut in the PWM subsystem as only one exists, but
> Backlight and MFD have a whole bunch, and I don't usually wait for
> them to Ack/Nack before applying or providing review comments.
> 
> I'm happy to play it however you like really.  I'm sure the boys and I
> can handle it if you so wish.  Even better if you would say in the
> MAINTAINERS file and provide review comments when patches are
> submitted.  I do think all 'drivers/video/backlight' changes should go
> in via the Backlight tree though.

Okay, that works for me.

Thierry

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

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

end of thread, other threads:[~2014-06-27  6:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-25  9:18 [PATCH] pwm-backlight: use devm_gpiod_get_optional() Alexandre Courbot
2014-06-25  9:18 ` Alexandre Courbot
2014-06-25  9:54 ` Lee Jones
2014-06-25  9:54   ` Lee Jones
2014-06-25 11:13   ` Thierry Reding
2014-06-25 11:13     ` Thierry Reding
2014-06-25 12:03     ` Lee Jones
2014-06-25 12:03       ` Lee Jones
2014-06-27  6:13       ` Thierry Reding
2014-06-27  6:13         ` Thierry Reding

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.