* [PATCH 4/6] pwm_backlight: Add deferred probe support
@ 2012-06-15 15:17 Laurent Pinchart
2012-06-17 23:38 ` Jingoo Han
2012-06-18 2:14 ` Simon Horman
0 siblings, 2 replies; 3+ messages in thread
From: Laurent Pinchart @ 2012-06-15 15:17 UTC (permalink / raw)
To: linux-fbdev
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 (possible
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@ideasonboard.com>
Cc: linux-fbdev@vger.kernel.org
---
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.3.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH 4/6] pwm_backlight: Add deferred probe support
2012-06-15 15:17 [PATCH 4/6] pwm_backlight: Add deferred probe support Laurent Pinchart
@ 2012-06-17 23:38 ` Jingoo Han
2012-06-18 2:14 ` Simon Horman
1 sibling, 0 replies; 3+ messages in thread
From: Jingoo Han @ 2012-06-17 23:38 UTC (permalink / raw)
To: linux-fbdev
On Saturday 16 June 2012 12:17:00 Laurent Pinchart wrote:
>
> 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 (possible
> integrated into the GPIO subsystem) to support generic PWM objects, and
> make sure the subsystem gets initialized first.
Cc'ed Grant Likely, Linus Walleij
Hi Laurent,
Yes, you're right. PWM subsystem is necessary to avoid the problem that PWM is not available at probe time.
Anyway, this patch looks good. Good luck.
Best regards,
Jingoo Han
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: linux-fbdev@vger.kernel.org
> ---
> 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.3.4
>
> --
> 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
* Re: [PATCH 4/6] pwm_backlight: Add deferred probe support
2012-06-15 15:17 [PATCH 4/6] pwm_backlight: Add deferred probe support Laurent Pinchart
2012-06-17 23:38 ` Jingoo Han
@ 2012-06-18 2:14 ` Simon Horman
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2012-06-18 2:14 UTC (permalink / raw)
To: linux-fbdev
On Fri, Jun 15, 2012 at 05:17:05PM +0200, Laurent Pinchart wrote:
> 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 (possible
> 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@ideasonboard.com>
> Cc: linux-fbdev@vger.kernel.org
Tested-by: Simon Horman <horms@verge.net.au>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-06-18 2:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-15 15:17 [PATCH 4/6] pwm_backlight: Add deferred probe support Laurent Pinchart
2012-06-17 23:38 ` Jingoo Han
2012-06-18 2:14 ` Simon Horman
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).