diff mbox

pwm-omap: handle timers not ready in probe

Message ID 20180716071323.GB23110@amd (mailing list archive)
State New, archived
Headers show

Commit Message

Pavel Machek July 16, 2018, 7:13 a.m. UTC
When all the drivers are built-in, timers are not ready and probing
fails. Fix that with -EPROBE_DEFFER.

Signed-off-by: Pavel Machek <pavel@ucw.cz>

Comments

Tony Lindgren July 16, 2018, 7:57 a.m. UTC | #1
* Pavel Machek <pavel@ucw.cz> [180716 07:16]:
> 
> When all the drivers are built-in, timers are not ready and probing
> fails. Fix that with -EPROBE_DEFFER.
> 
> Signed-off-by: Pavel Machek <pavel@ucw.cz>
> 
> diff --git a/drivers/pwm/pwm-omap-dmtimer.c b/drivers/pwm/pwm-omap-dmtimer.c
> index 665da3c..debeb70 100644
> --- a/drivers/pwm/pwm-omap-dmtimer.c
> +++ b/drivers/pwm/pwm-omap-dmtimer.c
> @@ -265,7 +271,7 @@ static int pwm_omap_dmtimer_probe(struct platform_device *pdev)
>  	timer_pdata = dev_get_platdata(&timer_pdev->dev);
>  	if (!timer_pdata) {
>  		dev_err(&pdev->dev, "dmtimer pdata structure NULL\n");
> -		ret = -EINVAL;
> +		ret = -EPROBE_DEFER;
>  		goto put;
>  	}

There seems to be an earlier similar patch, care to take a look
at "[PATCH] pwm: pwm-omap-dmtimer: return -EPROBE_DEFER if no
dmtimer platform data"?

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Pavel Machek July 16, 2018, 8:37 a.m. UTC | #2
On Mon 2018-07-16 00:57:40, Tony Lindgren wrote:
> * Pavel Machek <pavel@ucw.cz> [180716 07:16]:
> > 
> > When all the drivers are built-in, timers are not ready and probing
> > fails. Fix that with -EPROBE_DEFFER.
> > 
> > Signed-off-by: Pavel Machek <pavel@ucw.cz>
> > 
> > diff --git a/drivers/pwm/pwm-omap-dmtimer.c b/drivers/pwm/pwm-omap-dmtimer.c
> > index 665da3c..debeb70 100644
> > --- a/drivers/pwm/pwm-omap-dmtimer.c
> > +++ b/drivers/pwm/pwm-omap-dmtimer.c
> > @@ -265,7 +271,7 @@ static int pwm_omap_dmtimer_probe(struct platform_device *pdev)
> >  	timer_pdata = dev_get_platdata(&timer_pdev->dev);
> >  	if (!timer_pdata) {
> >  		dev_err(&pdev->dev, "dmtimer pdata structure NULL\n");
> > -		ret = -EINVAL;
> > +		ret = -EPROBE_DEFER;
> >  		goto put;
> >  	}
> 
> There seems to be an earlier similar patch, care to take a look
> at "[PATCH] pwm: pwm-omap-dmtimer: return -EPROBE_DEFER if no
> dmtimer platform data"?

Yes, that one is equivalent.

You can add

Acked-by: Pavel Machek <pavel@ucw.cz>
Tested-by: Pavel Machek <pavel@ucw.cz>

on it.

Thanks,
									Pavel
David Rivshin July 16, 2018, 3:47 p.m. UTC | #3
On Mon, 16 Jul 2018 10:37:20 +0200
Pavel Machek <pavel@ucw.cz> wrote:

> On Mon 2018-07-16 00:57:40, Tony Lindgren wrote:
> > * Pavel Machek <pavel@ucw.cz> [180716 07:16]:  
> > > 
> > > When all the drivers are built-in, timers are not ready and probing
> > > fails. Fix that with -EPROBE_DEFFER.
> > > 
> > > Signed-off-by: Pavel Machek <pavel@ucw.cz>
> > > 
> > > diff --git a/drivers/pwm/pwm-omap-dmtimer.c b/drivers/pwm/pwm-omap-dmtimer.c
> > > index 665da3c..debeb70 100644
> > > --- a/drivers/pwm/pwm-omap-dmtimer.c
> > > +++ b/drivers/pwm/pwm-omap-dmtimer.c
> > > @@ -265,7 +271,7 @@ static int pwm_omap_dmtimer_probe(struct platform_device *pdev)
> > >  	timer_pdata = dev_get_platdata(&timer_pdev->dev);
> > >  	if (!timer_pdata) {
> > >  		dev_err(&pdev->dev, "dmtimer pdata structure NULL\n");
> > > -		ret = -EINVAL;
> > > +		ret = -EPROBE_DEFER;
> > >  		goto put;
> > >  	}  
> > 
> > There seems to be an earlier similar patch, care to take a look
> > at "[PATCH] pwm: pwm-omap-dmtimer: return -EPROBE_DEFER if no
> > dmtimer platform data"?  
> 
> Yes, that one is equivalent.
> 
> You can add
> 
> Acked-by: Pavel Machek <pavel@ucw.cz>
> Tested-by: Pavel Machek <pavel@ucw.cz>
> 
> on it.
> 
> Thanks,
> 									Pavel

Thanks Pavel. I hadn't been watching the Droid 4 threads, so I didn't 
see you were hitting the same problem. I'm assuming the patch will go
through the PWM tree, so copying in Thierry.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/pwm/pwm-omap-dmtimer.c b/drivers/pwm/pwm-omap-dmtimer.c
index 665da3c..debeb70 100644
--- a/drivers/pwm/pwm-omap-dmtimer.c
+++ b/drivers/pwm/pwm-omap-dmtimer.c
@@ -265,7 +271,7 @@  static int pwm_omap_dmtimer_probe(struct platform_device *pdev)
 	timer_pdata = dev_get_platdata(&timer_pdev->dev);
 	if (!timer_pdata) {
 		dev_err(&pdev->dev, "dmtimer pdata structure NULL\n");
-		ret = -EINVAL;
+		ret = -EPROBE_DEFER;
 		goto put;
 	}