@@ -440,7 +440,8 @@ static int cz_probe(struct platform_device *pdev)
snd_soc_card_set_drvdata(card, machine);
ret = devm_snd_soc_register_card(&pdev->dev, &cz_card);
if (ret) {
- dev_err(&pdev->dev,
+ if (ret != -EPROBE_DEFER)
+ dev_err(&pdev->dev,
"devm_snd_soc_register_card(%s) failed: %d\n",
cz_card.name, ret);
return ret;
@@ -174,7 +174,8 @@ static int cz_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, card);
ret = devm_snd_soc_register_card(&pdev->dev, &cz_card);
if (ret) {
- dev_err(&pdev->dev,
+ if (ret != -EPROBE_DEFER)
+ dev_err(&pdev->dev,
"devm_snd_soc_register_card(%s) failed: %d\n",
cz_card.name, ret);
return ret;
@@ -346,7 +346,8 @@ static int acp3x_probe(struct platform_device *pdev)
ret = devm_snd_soc_register_card(&pdev->dev, &acp3x_card);
if (ret) {
- dev_err(&pdev->dev,
+ if (ret != -EPROBE_DEFER)
+ dev_err(&pdev->dev,
"devm_snd_soc_register_card(%s) failed: %d\n",
acp3x_card.name, ret);
return ret;
@@ -54,9 +54,10 @@ 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);
+ if (ret != -EPROBE_DEFER)
+ dev_err(&pdev->dev,
+ "snd_soc_register_card(%s) failed: %d\n",
+ acp_card.name, ret);
return ret;
}
return 0;
The machine driver module and codec driver module don't have dependency, it is possible that the machine driver is loaded ahead of the codec driver, then the register_card() will fail and return EPROBE_DEFER, in this case the driver should not print error log since this is not a real failure. For example, I saw this log from a machine with amd renoir audio: acp_pdm_mach acp_pdm_mach.0: snd_soc_register_card(acp) failed: -517 After applying this patch, there is no error log to confuse users and audio works after the codec driver is loaded. Signed-off-by: Hui Wang <hui.wang@canonical.com> --- sound/soc/amd/acp-da7219-max98357a.c | 3 ++- sound/soc/amd/acp-rt5645.c | 3 ++- sound/soc/amd/acp3x-rt5682-max9836.c | 3 ++- sound/soc/amd/renoir/acp3x-rn.c | 7 ++++--- 4 files changed, 10 insertions(+), 6 deletions(-)