diff mbox series

[v2] ASoC: amd: Don't show messages about deferred probing by default

Message ID 20210721183603.747-1-mario.limonciello@amd.com
State New
Headers show
Series [v2] ASoC: amd: Don't show messages about deferred probing by default | expand

Commit Message

Mario Limonciello July 21, 2021, 6:36 p.m. UTC
Nearly every boot with a Lenovo P14s is showing
acp_pdm_mach acp_pdm_mach.0: snd_soc_register_card(acp) failed: -517

This isn't useful to a user, especially as probing will run again.
Downgrade the message to debug, and only show errors.

CC: markpearson@lenovo.com
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 sound/soc/amd/renoir/acp3x-rn.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

Changes from v1->v2:
 * Simplify down to one return line.

Comments

Vijendar Mukunda July 22, 2021, 6:59 a.m. UTC | #1
On 7/22/21 12:06 AM, Mario Limonciello wrote:
> Nearly every boot with a Lenovo P14s is showing
> acp_pdm_mach acp_pdm_mach.0: snd_soc_register_card(acp) failed: -517
> 
> This isn't useful to a user, especially as probing will run again.
> Downgrade the message to debug, and only show errors.
> 
> CC: markpearson@lenovo.com
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>

Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
> ---
>  sound/soc/amd/renoir/acp3x-rn.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> Changes from v1->v2:
>  * Simplify down to one return line.
> 
> diff --git a/sound/soc/amd/renoir/acp3x-rn.c b/sound/soc/amd/renoir/acp3x-rn.c
> index 306134b89a82..ed73da496744 100644
> --- a/sound/soc/amd/renoir/acp3x-rn.c
> +++ b/sound/soc/amd/renoir/acp3x-rn.c
> @@ -54,12 +54,16 @@ static int acp_probe(struct platform_device *pdev)
>  	snd_soc_card_set_drvdata(card, machine);
>  	ret = devm_snd_soc_register_card(&pdev->dev, card);
>  	if (ret) {
> -		dev_err(&pdev->dev,
> -			"snd_soc_register_card(%s) failed: %d\n",
> -			acp_card.name, ret);
> -		return ret;
> +		if (ret != -EPROBE_DEFER)
> +			dev_err(&pdev->dev,
> +				"snd_soc_register_card(%s) failed: %d\n",
> +				card->name, ret);
> +		else
> +			dev_dbg(&pdev->dev,
> +				"snd_soc_register_card(%s) probe deferred: %d\n",
> +				card->name, ret);
>  	}
> -	return 0;
> +	return ret;
>  }
>  
>  static struct platform_driver acp_mach_driver = {
>
Mark Brown July 22, 2021, 11:18 a.m. UTC | #2
On Wed, Jul 21, 2021 at 01:36:02PM -0500, Mario Limonciello wrote:
> Nearly every boot with a Lenovo P14s is showing
> acp_pdm_mach acp_pdm_mach.0: snd_soc_register_card(acp) failed: -517
> 
> This isn't useful to a user, especially as probing will run again.
> Downgrade the message to debug, and only show errors.

dev_err_probe()
diff mbox series

Patch

diff --git a/sound/soc/amd/renoir/acp3x-rn.c b/sound/soc/amd/renoir/acp3x-rn.c
index 306134b89a82..ed73da496744 100644
--- a/sound/soc/amd/renoir/acp3x-rn.c
+++ b/sound/soc/amd/renoir/acp3x-rn.c
@@ -54,12 +54,16 @@  static int acp_probe(struct platform_device *pdev)
 	snd_soc_card_set_drvdata(card, machine);
 	ret = devm_snd_soc_register_card(&pdev->dev, card);
 	if (ret) {
-		dev_err(&pdev->dev,
-			"snd_soc_register_card(%s) failed: %d\n",
-			acp_card.name, ret);
-		return ret;
+		if (ret != -EPROBE_DEFER)
+			dev_err(&pdev->dev,
+				"snd_soc_register_card(%s) failed: %d\n",
+				card->name, ret);
+		else
+			dev_dbg(&pdev->dev,
+				"snd_soc_register_card(%s) probe deferred: %d\n",
+				card->name, ret);
 	}
-	return 0;
+	return ret;
 }
 
 static struct platform_driver acp_mach_driver = {