diff mbox series

[v2,03/10] ASoC: fsl_sai: Remove redundant error messages

Message ID 20261105104237.38542-4-phucduc.bui@gmail.com (mailing list archive)
State Handled Elsewhere
Headers show
Series ASoC: fsl_sai: Address several issues in the driver | expand

Commit Message

Bui Duc Phuc Nov. 5, 2026, 10:42 a.m. UTC
From: bui duc phuc <phucduc.bui@gmail.com>

The errors are either reported directly by these functions
or already reported deeper in the call chain, so additional
dev_err() and dev_warn() calls are unnecessary.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
 sound/soc/fsl/fsl_sai.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

Comments

Mark Brown Nov. 6, 2026, 2:18 p.m. UTC | #1
> The errors are either reported directly by these functions
> or already reported deeper in the call chain, so additional
> dev_err() and dev_warn() calls are unnecessary.

> @@ -1698,9 +1696,7 @@ static int fsl_sai_probe(struct platform_device *pdev)
>  	if (ret < 0)
>  		dev_warn(dev, "Error reading SAI version: %d\n", ret);
>  
> -	ret = fsl_sai_reset_hw(dev);
> -	if (ret < 0)
> -		dev_warn(dev, "Failed to reset hardware: %d\n", ret);
> +	fsl_sai_reset_hw(dev);

This is the only caller of fsl_sai_reset_hw(), it could just return void
now.

>  	ret = devm_request_irq(dev, irq, fsl_sai_isr, IRQF_SHARED,
>  			       np->name, sai);
> -	if (ret) {
> -		dev_err(dev, "failed to claim irq %u\n", irq);
> +	if (ret)
>  		goto err_pm_get_sync;
> -	}

This will only print an error for a subset of errors, things like -EBUSY
will now silently fail.
Bui Duc Phuc Nov. 9, 2026, 4:08 a.m. UTC | #2
Hi Mark,

Thank you for your review.

> >
> > -     ret = fsl_sai_reset_hw(dev);
> > -     if (ret < 0)
> > -             dev_warn(dev, "Failed to reset hardware: %d\n", ret);
> > +     fsl_sai_reset_hw(dev);
>
> This is the only caller of fsl_sai_reset_hw(), it could just return void
> now.
>

You're right.
I'll change fsl_sai_reset_hw() to return void.
Since this series has already been applied,
I'll send this as a separate patch.


> >       ret = devm_request_irq(dev, irq, fsl_sai_isr, IRQF_SHARED,
> >                              np->name, sai);
> > -     if (ret) {
> > -             dev_err(dev, "failed to claim irq %u\n", irq);
> > +     if (ret)
> >               goto err_pm_get_sync;
> > -     }
>
> This will only print an error for a subset of errors, things like -EBUSY
> will now silently fail.
>

From what I can see in the code, devm_request_irq() ->
devm_request_threaded_irq() reports every failure via dev_err_probe()
in devm_request_result(), so -EBUSY should be printed too.

Could you please point me to the path that fails silently?
I may have missed it.

Or did you mean fsl_sai_read_dlcfg()? It does have some silent
-EINVAL returns.
I'll restore that dev_err() together with the fsl_sai_reset_hw()
change I mentioned earlier.

Best regards,
Phuc
Mark Brown Nov. 9, 2026, 4:23 p.m. UTC | #3
On Mon, Nov 09, 2026 at 11:08:05AM +0700, Bui Duc Phuc wrote:

> > >       ret = devm_request_irq(dev, irq, fsl_sai_isr, IRQF_SHARED,
> > >                              np->name, sai);
> > > -     if (ret) {
> > > -             dev_err(dev, "failed to claim irq %u\n", irq);
> > > +     if (ret)
> > >               goto err_pm_get_sync;
> > > -     }

> > This will only print an error for a subset of errors, things like -EBUSY
> > will now silently fail.

> From what I can see in the code, devm_request_irq() ->
> devm_request_threaded_irq() reports every failure via dev_err_probe()
> in devm_request_result(), so -EBUSY should be printed too.

Ah, that's changed since I last looked.

> Or did you mean fsl_sai_read_dlcfg()? It does have some silent
> -EINVAL returns.
> I'll restore that dev_err() together with the fsl_sai_reset_hw()
> change I mentioned earlier.

That too.
diff mbox series

Patch

diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index 44a34f48a0cf..5532fab80be0 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -1615,10 +1615,8 @@  static int fsl_sai_probe(struct platform_device *pdev)
 
 	/* read dataline mask for rx and tx*/
 	ret = fsl_sai_read_dlcfg(sai);
-	if (ret < 0) {
-		dev_err(dev, "failed to read dlcfg %d\n", ret);
+	if (ret < 0)
 		return ret;
-	}
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0)
@@ -1698,9 +1696,7 @@  static int fsl_sai_probe(struct platform_device *pdev)
 	if (ret < 0)
 		dev_warn(dev, "Error reading SAI version: %d\n", ret);
 
-	ret = fsl_sai_reset_hw(dev);
-	if (ret < 0)
-		dev_warn(dev, "Failed to reset hardware: %d\n", ret);
+	fsl_sai_reset_hw(dev);
 
 	/* Select MCLK direction */
 	if (sai->mclk_direction_output &&
@@ -1715,10 +1711,8 @@  static int fsl_sai_probe(struct platform_device *pdev)
 
 	ret = devm_request_irq(dev, irq, fsl_sai_isr, IRQF_SHARED,
 			       np->name, sai);
-	if (ret) {
-		dev_err(dev, "failed to claim irq %u\n", irq);
+	if (ret)
 		goto err_pm_get_sync;
-	}
 
 	if (of_device_is_compatible(np, "fsl,imx952-sai") &&
 	    !of_property_read_string(np, "fsl,sai-amix-mode", &str)) {