Commit d0ada202 authored by Cristian Ciocaltea's avatar Cristian Ciocaltea Committed by Mark Brown

ASoC: amd: acp: Add missing error handling in sof-mach

Handle potential acp_sofdsp_dai_links_create() errors in ACP SOF machine
driver's probe function.  Note there is no need for an undo.

While at it, switch to dev_err_probe().

Fixes: 9f84940f ("ASoC: amd: acp: Add SOF audio support on Chrome board")
Signed-off-by: default avatarCristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: default avatarEmil Velikov <emil.velikov@collabora.com>
Link: https://msgid.link/r/20231219030728.2431640-4-cristian.ciocaltea@collabora.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 68ab2942
...@@ -112,16 +112,14 @@ static int acp_sof_probe(struct platform_device *pdev) ...@@ -112,16 +112,14 @@ static int acp_sof_probe(struct platform_device *pdev)
if (dmi_id && dmi_id->driver_data) if (dmi_id && dmi_id->driver_data)
acp_card_drvdata->tdm_mode = dmi_id->driver_data; acp_card_drvdata->tdm_mode = dmi_id->driver_data;
acp_sofdsp_dai_links_create(card); ret = acp_sofdsp_dai_links_create(card);
if (ret)
return dev_err_probe(&pdev->dev, ret, "Failed to create DAI links\n");
ret = devm_snd_soc_register_card(&pdev->dev, card); ret = devm_snd_soc_register_card(&pdev->dev, card);
if (ret) { if (ret)
dev_err(&pdev->dev, return dev_err_probe(&pdev->dev, ret,
"devm_snd_soc_register_card(%s) failed: %d\n", "Failed to register card(%s)\n", card->name);
card->name, ret);
return ret;
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment