If the PWM instance is not available yet at probe time, request a
deferred probe.
A better way to fix might be to create a PWM subsystem (possibly
integrated into the GPIO subsystem) to support generic PWM objects, and
make sure the subsystem gets initialized first.
Signed-off-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
Tested-by: Simon Horman <horms@xxxxxxxxxxxx>
---
drivers/video/backlight/pwm_bl.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index 342b7d7..5df8b91 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -121,6 +121,8 @@ static int pwm_backlight_probe(struct platform_device *pdev)
if (IS_ERR(pb->pwm)) {
dev_err(&pdev->dev, "unable to request PWM for backlight\n");
ret = PTR_ERR(pb->pwm);
+ if (ret == -ENODEV)
+ ret = -EPROBE_DEFER;
goto err_alloc;
} else
dev_dbg(&pdev->dev, "got pwm for backlight\n");
--
1.7.8.6
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Linux OMAP]
[Linux USB Devel]
[Video for Linux]
[Linux Audio Users]
[Photo]
[Yosemite News]
[Yosemite Photos]
[Free Online Dating]
[Linux Kernel]
[Linux SCSI]
[XFree86]