[PATCH] ASoC: mediatek: mt7986: silence error in case of -EPROBE_DEFER

AngeloGioacchino Del Regno angelogioacchino.delregno at collabora.com
Mon Dec 11 01:48:54 PST 2023


Il 11/12/23 02:33, Daniel Golle ha scritto:
> If probe is defered no error should be printed. Mute it.
> 
> Signed-off-by: Daniel Golle <daniel at makrotopia.org>
> ---
>   sound/soc/mediatek/mt7986/mt7986-wm8960.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/mediatek/mt7986/mt7986-wm8960.c b/sound/soc/mediatek/mt7986/mt7986-wm8960.c
> index c1390b3734101..24a4b943030d7 100644
> --- a/sound/soc/mediatek/mt7986/mt7986-wm8960.c
> +++ b/sound/soc/mediatek/mt7986/mt7986-wm8960.c
> @@ -144,7 +144,9 @@ static int mt7986_wm8960_machine_probe(struct platform_device *pdev)
>   
>   	ret = devm_snd_soc_register_card(&pdev->dev, card);
>   	if (ret) {
> -		dev_err(&pdev->dev, "%s snd_soc_register_card fail: %d\n", __func__, ret);
> +		if (ret != -EPROBE_DEFER)
> +			dev_err(&pdev->dev, "%s snd_soc_register_card fail: %d\n", __func__, ret);

This is *exactly* what dev_err_probe() does! :-)

dev_err_probe(&pdev->dev, ret, "%s snd_soc_register_card fail: %d\n", __func__);

Regards,
Angelo





More information about the linux-arm-kernel mailing list