All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: pwm-regulator: Make use of the helper function dev_err_probe()
@ 2021-09-19 21:11 ` Anand Moon
  0 siblings, 0 replies; 9+ messages in thread
From: Anand Moon @ 2021-09-19 21:11 UTC (permalink / raw)
  To: linux-arm-kernel, linux-amlogic, linux-kernel
  Cc: Anand Moon, Martin Blumenstingl, Liam Girdwood, Mark Brown, Jon Hunter

devm_regulator_register can return -EPROBE_DEFER if the
regulator is not ready yet. Use dev_err_probe() for
pwm regulator resources to indicate the deferral reason
when waiting for the resource to come up.

Fixes: 0cd71b9a43ad ("regulator: pwm: Don't warn on probe deferral")

Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
 drivers/regulator/pwm-regulator.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/regulator/pwm-regulator.c b/drivers/regulator/pwm-regulator.c
index 7629476d94ae..451e57a739f8 100644
--- a/drivers/regulator/pwm-regulator.c
+++ b/drivers/regulator/pwm-regulator.c
@@ -382,9 +382,9 @@ static int pwm_regulator_probe(struct platform_device *pdev)
 					    &drvdata->desc, &config);
 	if (IS_ERR(regulator)) {
 		ret = PTR_ERR(regulator);
-		dev_err(&pdev->dev, "Failed to register regulator %s: %d\n",
-			drvdata->desc.name, ret);
-		return ret;
+		return dev_err_probe(&pdev->dev, ret,
+				     "Failed to register regulator %s: %d\n",
+				     drvdata->desc.name, ret);
 	}
 
 	return 0;
-- 
2.33.0


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

* [PATCH] regulator: pwm-regulator: Make use of the helper function dev_err_probe()
@ 2021-09-19 21:11 ` Anand Moon
  0 siblings, 0 replies; 9+ messages in thread
From: Anand Moon @ 2021-09-19 21:11 UTC (permalink / raw)
  To: linux-arm-kernel, linux-amlogic, linux-kernel
  Cc: Anand Moon, Martin Blumenstingl, Liam Girdwood, Mark Brown, Jon Hunter

devm_regulator_register can return -EPROBE_DEFER if the
regulator is not ready yet. Use dev_err_probe() for
pwm regulator resources to indicate the deferral reason
when waiting for the resource to come up.

Fixes: 0cd71b9a43ad ("regulator: pwm: Don't warn on probe deferral")

Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
 drivers/regulator/pwm-regulator.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/regulator/pwm-regulator.c b/drivers/regulator/pwm-regulator.c
index 7629476d94ae..451e57a739f8 100644
--- a/drivers/regulator/pwm-regulator.c
+++ b/drivers/regulator/pwm-regulator.c
@@ -382,9 +382,9 @@ static int pwm_regulator_probe(struct platform_device *pdev)
 					    &drvdata->desc, &config);
 	if (IS_ERR(regulator)) {
 		ret = PTR_ERR(regulator);
-		dev_err(&pdev->dev, "Failed to register regulator %s: %d\n",
-			drvdata->desc.name, ret);
-		return ret;
+		return dev_err_probe(&pdev->dev, ret,
+				     "Failed to register regulator %s: %d\n",
+				     drvdata->desc.name, ret);
 	}
 
 	return 0;
-- 
2.33.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH] regulator: pwm-regulator: Make use of the helper function dev_err_probe()
@ 2021-09-19 21:11 ` Anand Moon
  0 siblings, 0 replies; 9+ messages in thread
From: Anand Moon @ 2021-09-19 21:11 UTC (permalink / raw)
  To: linux-arm-kernel, linux-amlogic, linux-kernel
  Cc: Anand Moon, Martin Blumenstingl, Liam Girdwood, Mark Brown, Jon Hunter

devm_regulator_register can return -EPROBE_DEFER if the
regulator is not ready yet. Use dev_err_probe() for
pwm regulator resources to indicate the deferral reason
when waiting for the resource to come up.

Fixes: 0cd71b9a43ad ("regulator: pwm: Don't warn on probe deferral")

Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
 drivers/regulator/pwm-regulator.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/regulator/pwm-regulator.c b/drivers/regulator/pwm-regulator.c
index 7629476d94ae..451e57a739f8 100644
--- a/drivers/regulator/pwm-regulator.c
+++ b/drivers/regulator/pwm-regulator.c
@@ -382,9 +382,9 @@ static int pwm_regulator_probe(struct platform_device *pdev)
 					    &drvdata->desc, &config);
 	if (IS_ERR(regulator)) {
 		ret = PTR_ERR(regulator);
-		dev_err(&pdev->dev, "Failed to register regulator %s: %d\n",
-			drvdata->desc.name, ret);
-		return ret;
+		return dev_err_probe(&pdev->dev, ret,
+				     "Failed to register regulator %s: %d\n",
+				     drvdata->desc.name, ret);
 	}
 
 	return 0;
-- 
2.33.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] regulator: pwm-regulator: Make use of the helper function dev_err_probe()
  2021-09-19 21:11 ` Anand Moon
  (?)
@ 2021-09-20  8:26   ` Neil Armstrong
  -1 siblings, 0 replies; 9+ messages in thread
From: Neil Armstrong @ 2021-09-20  8:26 UTC (permalink / raw)
  To: Anand Moon, linux-arm-kernel, linux-amlogic, linux-kernel
  Cc: Martin Blumenstingl, Liam Girdwood, Mark Brown, Jon Hunter

On 19/09/2021 23:11, Anand Moon wrote:
> devm_regulator_register can return -EPROBE_DEFER if the
> regulator is not ready yet. Use dev_err_probe() for
> pwm regulator resources to indicate the deferral reason
> when waiting for the resource to come up.
> 
> Fixes: 0cd71b9a43ad ("regulator: pwm: Don't warn on probe deferral")
> 
> Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> ---
>  drivers/regulator/pwm-regulator.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/regulator/pwm-regulator.c b/drivers/regulator/pwm-regulator.c
> index 7629476d94ae..451e57a739f8 100644
> --- a/drivers/regulator/pwm-regulator.c
> +++ b/drivers/regulator/pwm-regulator.c
> @@ -382,9 +382,9 @@ static int pwm_regulator_probe(struct platform_device *pdev)
>  					    &drvdata->desc, &config);
>  	if (IS_ERR(regulator)) {
>  		ret = PTR_ERR(regulator);
> -		dev_err(&pdev->dev, "Failed to register regulator %s: %d\n",
> -			drvdata->desc.name, ret);
> -		return ret;
> +		return dev_err_probe(&pdev->dev, ret,
> +				     "Failed to register regulator %s: %d\n",
> +				     drvdata->desc.name, ret);

No need to keep ret and print it since it will be printed by dev_err_probe, pass directly PTR_ERR(regulator) and drop the ": %d" from the error string.

Neil


>  	}
>  
>  	return 0;
> 


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

* Re: [PATCH] regulator: pwm-regulator: Make use of the helper function dev_err_probe()
@ 2021-09-20  8:26   ` Neil Armstrong
  0 siblings, 0 replies; 9+ messages in thread
From: Neil Armstrong @ 2021-09-20  8:26 UTC (permalink / raw)
  To: Anand Moon, linux-arm-kernel, linux-amlogic, linux-kernel
  Cc: Martin Blumenstingl, Liam Girdwood, Mark Brown, Jon Hunter

On 19/09/2021 23:11, Anand Moon wrote:
> devm_regulator_register can return -EPROBE_DEFER if the
> regulator is not ready yet. Use dev_err_probe() for
> pwm regulator resources to indicate the deferral reason
> when waiting for the resource to come up.
> 
> Fixes: 0cd71b9a43ad ("regulator: pwm: Don't warn on probe deferral")
> 
> Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> ---
>  drivers/regulator/pwm-regulator.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/regulator/pwm-regulator.c b/drivers/regulator/pwm-regulator.c
> index 7629476d94ae..451e57a739f8 100644
> --- a/drivers/regulator/pwm-regulator.c
> +++ b/drivers/regulator/pwm-regulator.c
> @@ -382,9 +382,9 @@ static int pwm_regulator_probe(struct platform_device *pdev)
>  					    &drvdata->desc, &config);
>  	if (IS_ERR(regulator)) {
>  		ret = PTR_ERR(regulator);
> -		dev_err(&pdev->dev, "Failed to register regulator %s: %d\n",
> -			drvdata->desc.name, ret);
> -		return ret;
> +		return dev_err_probe(&pdev->dev, ret,
> +				     "Failed to register regulator %s: %d\n",
> +				     drvdata->desc.name, ret);

No need to keep ret and print it since it will be printed by dev_err_probe, pass directly PTR_ERR(regulator) and drop the ": %d" from the error string.

Neil


>  	}
>  
>  	return 0;
> 


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH] regulator: pwm-regulator: Make use of the helper function dev_err_probe()
@ 2021-09-20  8:26   ` Neil Armstrong
  0 siblings, 0 replies; 9+ messages in thread
From: Neil Armstrong @ 2021-09-20  8:26 UTC (permalink / raw)
  To: Anand Moon, linux-arm-kernel, linux-amlogic, linux-kernel
  Cc: Martin Blumenstingl, Liam Girdwood, Mark Brown, Jon Hunter

On 19/09/2021 23:11, Anand Moon wrote:
> devm_regulator_register can return -EPROBE_DEFER if the
> regulator is not ready yet. Use dev_err_probe() for
> pwm regulator resources to indicate the deferral reason
> when waiting for the resource to come up.
> 
> Fixes: 0cd71b9a43ad ("regulator: pwm: Don't warn on probe deferral")
> 
> Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> ---
>  drivers/regulator/pwm-regulator.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/regulator/pwm-regulator.c b/drivers/regulator/pwm-regulator.c
> index 7629476d94ae..451e57a739f8 100644
> --- a/drivers/regulator/pwm-regulator.c
> +++ b/drivers/regulator/pwm-regulator.c
> @@ -382,9 +382,9 @@ static int pwm_regulator_probe(struct platform_device *pdev)
>  					    &drvdata->desc, &config);
>  	if (IS_ERR(regulator)) {
>  		ret = PTR_ERR(regulator);
> -		dev_err(&pdev->dev, "Failed to register regulator %s: %d\n",
> -			drvdata->desc.name, ret);
> -		return ret;
> +		return dev_err_probe(&pdev->dev, ret,
> +				     "Failed to register regulator %s: %d\n",
> +				     drvdata->desc.name, ret);

No need to keep ret and print it since it will be printed by dev_err_probe, pass directly PTR_ERR(regulator) and drop the ": %d" from the error string.

Neil


>  	}
>  
>  	return 0;
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] regulator: pwm-regulator: Make use of the helper function dev_err_probe()
  2021-09-20  8:26   ` Neil Armstrong
  (?)
@ 2021-09-20 18:05     ` Anand Moon
  -1 siblings, 0 replies; 9+ messages in thread
From: Anand Moon @ 2021-09-20 18:05 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: linux-arm-kernel, linux-amlogic, Linux Kernel,
	Martin Blumenstingl, Liam Girdwood, Mark Brown, Jon Hunter

Hi Neil,

On Mon, 20 Sept 2021 at 13:56, Neil Armstrong <narmstrong@baylibre.com> wrote:
>
> On 19/09/2021 23:11, Anand Moon wrote:
> > devm_regulator_register can return -EPROBE_DEFER if the
> > regulator is not ready yet. Use dev_err_probe() for
> > pwm regulator resources to indicate the deferral reason
> > when waiting for the resource to come up.
> >
> > Fixes: 0cd71b9a43ad ("regulator: pwm: Don't warn on probe deferral")
> >
> > Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> > Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> > ---
> >  drivers/regulator/pwm-regulator.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/regulator/pwm-regulator.c b/drivers/regulator/pwm-regulator.c
> > index 7629476d94ae..451e57a739f8 100644
> > --- a/drivers/regulator/pwm-regulator.c
> > +++ b/drivers/regulator/pwm-regulator.c
> > @@ -382,9 +382,9 @@ static int pwm_regulator_probe(struct platform_device *pdev)
> >                                           &drvdata->desc, &config);
> >       if (IS_ERR(regulator)) {
> >               ret = PTR_ERR(regulator);
> > -             dev_err(&pdev->dev, "Failed to register regulator %s: %d\n",
> > -                     drvdata->desc.name, ret);
> > -             return ret;
> > +             return dev_err_probe(&pdev->dev, ret,
> > +                                  "Failed to register regulator %s: %d\n",
> > +                                  drvdata->desc.name, ret);
>
> No need to keep ret and print it since it will be printed by dev_err_probe, pass directly PTR_ERR(regulator) and drop the ": %d" from the error string.
>
> Neil
>

Thanks for the input but it's a wrong fix I meant to fix another probe
defer with *devm_pwm_get*
I will correct this in the next version..

Thanks
-Anand

>
> >       }
> >
> >       return 0;
> >
>

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH] regulator: pwm-regulator: Make use of the helper function dev_err_probe()
@ 2021-09-20 18:05     ` Anand Moon
  0 siblings, 0 replies; 9+ messages in thread
From: Anand Moon @ 2021-09-20 18:05 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: linux-arm-kernel, linux-amlogic, Linux Kernel,
	Martin Blumenstingl, Liam Girdwood, Mark Brown, Jon Hunter

Hi Neil,

On Mon, 20 Sept 2021 at 13:56, Neil Armstrong <narmstrong@baylibre.com> wrote:
>
> On 19/09/2021 23:11, Anand Moon wrote:
> > devm_regulator_register can return -EPROBE_DEFER if the
> > regulator is not ready yet. Use dev_err_probe() for
> > pwm regulator resources to indicate the deferral reason
> > when waiting for the resource to come up.
> >
> > Fixes: 0cd71b9a43ad ("regulator: pwm: Don't warn on probe deferral")
> >
> > Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> > Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> > ---
> >  drivers/regulator/pwm-regulator.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/regulator/pwm-regulator.c b/drivers/regulator/pwm-regulator.c
> > index 7629476d94ae..451e57a739f8 100644
> > --- a/drivers/regulator/pwm-regulator.c
> > +++ b/drivers/regulator/pwm-regulator.c
> > @@ -382,9 +382,9 @@ static int pwm_regulator_probe(struct platform_device *pdev)
> >                                           &drvdata->desc, &config);
> >       if (IS_ERR(regulator)) {
> >               ret = PTR_ERR(regulator);
> > -             dev_err(&pdev->dev, "Failed to register regulator %s: %d\n",
> > -                     drvdata->desc.name, ret);
> > -             return ret;
> > +             return dev_err_probe(&pdev->dev, ret,
> > +                                  "Failed to register regulator %s: %d\n",
> > +                                  drvdata->desc.name, ret);
>
> No need to keep ret and print it since it will be printed by dev_err_probe, pass directly PTR_ERR(regulator) and drop the ": %d" from the error string.
>
> Neil
>

Thanks for the input but it's a wrong fix I meant to fix another probe
defer with *devm_pwm_get*
I will correct this in the next version..

Thanks
-Anand

>
> >       }
> >
> >       return 0;
> >
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] regulator: pwm-regulator: Make use of the helper function dev_err_probe()
@ 2021-09-20 18:05     ` Anand Moon
  0 siblings, 0 replies; 9+ messages in thread
From: Anand Moon @ 2021-09-20 18:05 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: linux-arm-kernel, linux-amlogic, Linux Kernel,
	Martin Blumenstingl, Liam Girdwood, Mark Brown, Jon Hunter

Hi Neil,

On Mon, 20 Sept 2021 at 13:56, Neil Armstrong <narmstrong@baylibre.com> wrote:
>
> On 19/09/2021 23:11, Anand Moon wrote:
> > devm_regulator_register can return -EPROBE_DEFER if the
> > regulator is not ready yet. Use dev_err_probe() for
> > pwm regulator resources to indicate the deferral reason
> > when waiting for the resource to come up.
> >
> > Fixes: 0cd71b9a43ad ("regulator: pwm: Don't warn on probe deferral")
> >
> > Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> > Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> > ---
> >  drivers/regulator/pwm-regulator.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/regulator/pwm-regulator.c b/drivers/regulator/pwm-regulator.c
> > index 7629476d94ae..451e57a739f8 100644
> > --- a/drivers/regulator/pwm-regulator.c
> > +++ b/drivers/regulator/pwm-regulator.c
> > @@ -382,9 +382,9 @@ static int pwm_regulator_probe(struct platform_device *pdev)
> >                                           &drvdata->desc, &config);
> >       if (IS_ERR(regulator)) {
> >               ret = PTR_ERR(regulator);
> > -             dev_err(&pdev->dev, "Failed to register regulator %s: %d\n",
> > -                     drvdata->desc.name, ret);
> > -             return ret;
> > +             return dev_err_probe(&pdev->dev, ret,
> > +                                  "Failed to register regulator %s: %d\n",
> > +                                  drvdata->desc.name, ret);
>
> No need to keep ret and print it since it will be printed by dev_err_probe, pass directly PTR_ERR(regulator) and drop the ": %d" from the error string.
>
> Neil
>

Thanks for the input but it's a wrong fix I meant to fix another probe
defer with *devm_pwm_get*
I will correct this in the next version..

Thanks
-Anand

>
> >       }
> >
> >       return 0;
> >
>

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

end of thread, other threads:[~2021-09-21  1:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-19 21:11 [PATCH] regulator: pwm-regulator: Make use of the helper function dev_err_probe() Anand Moon
2021-09-19 21:11 ` Anand Moon
2021-09-19 21:11 ` Anand Moon
2021-09-20  8:26 ` Neil Armstrong
2021-09-20  8:26   ` Neil Armstrong
2021-09-20  8:26   ` Neil Armstrong
2021-09-20 18:05   ` Anand Moon
2021-09-20 18:05     ` Anand Moon
2021-09-20 18:05     ` Anand Moon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.