diff mbox series

clk: meson: axg-audio: do not print error on defer

Message ID 20210429090516.61085-1-jbrunet@baylibre.com (mailing list archive)
State New
Delegated to: Neil Armstrong
Headers show
Series clk: meson: axg-audio: do not print error on defer | expand

Commit Message

Jerome Brunet April 29, 2021, 9:05 a.m. UTC
Do not print an error if we are just waiting for the reset controller to
come up.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 drivers/clk/meson/axg-audio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Neil Armstrong April 29, 2021, 9:20 a.m. UTC | #1
On 29/04/2021 11:05, Jerome Brunet wrote:
> Do not print an error if we are just waiting for the reset controller to
> come up.
> 
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> ---
>  drivers/clk/meson/axg-audio.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/meson/axg-audio.c b/drivers/clk/meson/axg-audio.c
> index 7c8d02164443..5e501eff0840 100644
> --- a/drivers/clk/meson/axg-audio.c
> +++ b/drivers/clk/meson/axg-audio.c
> @@ -1811,7 +1811,8 @@ static int axg_audio_clkc_probe(struct platform_device *pdev)
>  
>  	ret = device_reset(dev);
>  	if (ret) {
> -		dev_err(dev, "failed to reset device\n");
> +		if (ret != -EPROBE_DEFER)
> +			dev_err(dev, "failed to reset device\n");
>  		return ret;
>  	}
>  
> 

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Martin Blumenstingl April 29, 2021, 8:49 p.m. UTC | #2
Hi Jerome,

On Thu, Apr 29, 2021 at 11:06 AM Jerome Brunet <jbrunet@baylibre.com> wrote:
[...]
> diff --git a/drivers/clk/meson/axg-audio.c b/drivers/clk/meson/axg-audio.c
> index 7c8d02164443..5e501eff0840 100644
> --- a/drivers/clk/meson/axg-audio.c
> +++ b/drivers/clk/meson/axg-audio.c
> @@ -1811,7 +1811,8 @@ static int axg_audio_clkc_probe(struct platform_device *pdev)
>
>         ret = device_reset(dev);
>         if (ret) {
> -               dev_err(dev, "failed to reset device\n");
> +               if (ret != -EPROBE_DEFER)
> +                       dev_err(dev, "failed to reset device\n");
many drivers are switching to dev_err_probe nowadays
According to it's documentation:
  In case of -EPROBE_DEFER it sets also defer probe reason, which can be
  checked later by reading devices_deferred debugfs attribute.

so I think it makes sense to use dev_err_probe here as well


Best regards,
Martin
Stephen Boyd April 30, 2021, 2:02 a.m. UTC | #3
Quoting Martin Blumenstingl (2021-04-29 13:49:54)
> Hi Jerome,
> 
> On Thu, Apr 29, 2021 at 11:06 AM Jerome Brunet <jbrunet@baylibre.com> wrote:
> [...]
> > diff --git a/drivers/clk/meson/axg-audio.c b/drivers/clk/meson/axg-audio.c
> > index 7c8d02164443..5e501eff0840 100644
> > --- a/drivers/clk/meson/axg-audio.c
> > +++ b/drivers/clk/meson/axg-audio.c
> > @@ -1811,7 +1811,8 @@ static int axg_audio_clkc_probe(struct platform_device *pdev)
> >
> >         ret = device_reset(dev);
> >         if (ret) {
> > -               dev_err(dev, "failed to reset device\n");
> > +               if (ret != -EPROBE_DEFER)
> > +                       dev_err(dev, "failed to reset device\n");
> many drivers are switching to dev_err_probe nowadays
> According to it's documentation:
>   In case of -EPROBE_DEFER it sets also defer probe reason, which can be
>   checked later by reading devices_deferred debugfs attribute.
> 
> so I think it makes sense to use dev_err_probe here as well
> 
> 

Yes please use dev_err_probe()
Jerome Brunet April 30, 2021, 8:02 a.m. UTC | #4
On Thu 29 Apr 2021 at 22:49, Martin Blumenstingl <martin.blumenstingl@googlemail.com> wrote:

> Hi Jerome,
>
> On Thu, Apr 29, 2021 at 11:06 AM Jerome Brunet <jbrunet@baylibre.com> wrote:
> [...]
>> diff --git a/drivers/clk/meson/axg-audio.c b/drivers/clk/meson/axg-audio.c
>> index 7c8d02164443..5e501eff0840 100644
>> --- a/drivers/clk/meson/axg-audio.c
>> +++ b/drivers/clk/meson/axg-audio.c
>> @@ -1811,7 +1811,8 @@ static int axg_audio_clkc_probe(struct platform_device *pdev)
>>
>>         ret = device_reset(dev);
>>         if (ret) {
>> -               dev_err(dev, "failed to reset device\n");
>> +               if (ret != -EPROBE_DEFER)
>> +                       dev_err(dev, "failed to reset device\n");
> many drivers are switching to dev_err_probe nowadays
> According to it's documentation:
>   In case of -EPROBE_DEFER it sets also defer probe reason, which can be
>   checked later by reading devices_deferred debugfs attribute.
>
> so I think it makes sense to use dev_err_probe here as well

Old habits ;) thanks for pointing this out. Will do

>
>
> Best regards,
> Martin
diff mbox series

Patch

diff --git a/drivers/clk/meson/axg-audio.c b/drivers/clk/meson/axg-audio.c
index 7c8d02164443..5e501eff0840 100644
--- a/drivers/clk/meson/axg-audio.c
+++ b/drivers/clk/meson/axg-audio.c
@@ -1811,7 +1811,8 @@  static int axg_audio_clkc_probe(struct platform_device *pdev)
 
 	ret = device_reset(dev);
 	if (ret) {
-		dev_err(dev, "failed to reset device\n");
+		if (ret != -EPROBE_DEFER)
+			dev_err(dev, "failed to reset device\n");
 		return ret;
 	}