linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pwm-backlight: fix probing from device-tree without enable-gpios
@ 2014-07-25 10:28 Michael Olbrich
  2014-07-25 11:47 ` [PATCH v2] " Michael Olbrich
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Olbrich @ 2014-07-25 10:28 UTC (permalink / raw)
  To: Thierry Reding, Bryan Wu, Lee Jones, Alexandre Courbot
  Cc: linux-pwm, linux-fbdev, linux-kernel, kernel, Michael Olbrich

Since 257462dbf3ed ("pwm-backlight: switch to gpiod interface")
enable_gpio is no longer set and remains 0 when probing from
device-tree. This is a valid gpio number. With no enable-gpios
specified in the device-tree this is used and probing fails
with:

pwm-backlight lcd-backlight.3: failed to request GPIO#0: -16

Fix this by setting enable_gpio to -1 which is not a valid gpio
number.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
 drivers/video/backlight/pwm_bl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index 38ca88b..5213d13 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -211,6 +211,7 @@ static int pwm_backlight_probe(struct platform_device *pdev)
 			dev_err(&pdev->dev, "failed to find platform data\n");
 			return ret;
 		}
+		devdata.enable_gpio = -1;
 
 		data = &defdata;
 	}
-- 
2.0.1


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

* [PATCH v2] pwm-backlight: fix probing from device-tree without enable-gpios
  2014-07-25 10:28 [PATCH] pwm-backlight: fix probing from device-tree without enable-gpios Michael Olbrich
@ 2014-07-25 11:47 ` Michael Olbrich
  2014-07-25 14:46   ` Alexandre Courbot
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Olbrich @ 2014-07-25 11:47 UTC (permalink / raw)
  To: Thierry Reding, Bryan Wu, Lee Jones, Alexandre Courbot
  Cc: linux-pwm, linux-fbdev, linux-kernel, kernel, Michael Olbrich

Since 257462dbf3ed ("pwm-backlight: switch to gpiod interface")
enable_gpio is no longer set and remains 0 when probing from
device-tree. This is a valid gpio number. With no enable-gpios
specified in the device-tree this is used and probing fails
with:

pwm-backlight lcd-backlight.3: failed to request GPIO#0: -16

Fix this by setting enable_gpio to -1 which is not a valid gpio
number.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---

Sorry, I sent the wrong version. This one actually compiles.

Michael

 drivers/video/backlight/pwm_bl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index 38ca88b..e7e43cd 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -211,6 +211,7 @@ static int pwm_backlight_probe(struct platform_device *pdev)
 			dev_err(&pdev->dev, "failed to find platform data\n");
 			return ret;
 		}
+		defdata.enable_gpio = -1;
 
 		data = &defdata;
 	}
-- 
2.0.1


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

* Re: [PATCH v2] pwm-backlight: fix probing from device-tree without enable-gpios
  2014-07-25 11:47 ` [PATCH v2] " Michael Olbrich
@ 2014-07-25 14:46   ` Alexandre Courbot
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Courbot @ 2014-07-25 14:46 UTC (permalink / raw)
  To: Michael Olbrich
  Cc: Thierry Reding, Bryan Wu, Lee Jones, Alexandre Courbot,
	linux-pwm@vger.kernel.org, linux-fbdev@vger.kernel.org,
	Linux Kernel Mailing List, Sascha Hauer

On Fri, Jul 25, 2014 at 8:47 PM, Michael Olbrich
<m.olbrich@pengutronix.de> wrote:
> Since 257462dbf3ed ("pwm-backlight: switch to gpiod interface")
> enable_gpio is no longer set and remains 0 when probing from
> device-tree. This is a valid gpio number. With no enable-gpios
> specified in the device-tree this is used and probing fails
> with:
>
> pwm-backlight lcd-backlight.3: failed to request GPIO#0: -16
>
> Fix this by setting enable_gpio to -1 which is not a valid gpio
> number.

Looks good indeed. My bad for overlooking this.

Acked-by: Alexandre Courbot <acourbot@nvidia.com>

>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> ---
>
> Sorry, I sent the wrong version. This one actually compiles.
>
> Michael
>
>  drivers/video/backlight/pwm_bl.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
> index 38ca88b..e7e43cd 100644
> --- a/drivers/video/backlight/pwm_bl.c
> +++ b/drivers/video/backlight/pwm_bl.c
> @@ -211,6 +211,7 @@ static int pwm_backlight_probe(struct platform_device *pdev)
>                         dev_err(&pdev->dev, "failed to find platform data\n");
>                         return ret;
>                 }
> +               defdata.enable_gpio = -1;
>
>                 data = &defdata;
>         }
> --
> 2.0.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2014-07-25 14:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-25 10:28 [PATCH] pwm-backlight: fix probing from device-tree without enable-gpios Michael Olbrich
2014-07-25 11:47 ` [PATCH v2] " Michael Olbrich
2014-07-25 14:46   ` Alexandre Courbot

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).