pwm-backlight: fix probing from device-tree without enable-gpios

Started by Michael Olbrich on Jul 25, 2014 · 3 messages from 2 authors · Last reply Jul 25, 2014

Subsystems (3)

Maintainers (5)

Show 1 more
STALE4486d

open the first message on its own page

  1. [PATCH v2] pwm-backlight: fix probing from device-tree without enable-gpios
    Related patches
Message details and related content
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 <redacted>
---
 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

[PATCH v2] pwm-backlight: fix probing from device-tree without enable-gpios

Message details and related content
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 <redacted>
---

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

Re: [PATCH v2] pwm-backlight: fix probing from device-tree without enable-gpios

Message details and related content
On Fri, Jul 25, 2014 at 8:47 PM, Michael Olbrich
[off-list ref] 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>
quoted hunk
Signed-off-by: Michael Olbrich <redacted>
---

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
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help