Commit 2e6f557c authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: fsl: Use dev_err_probe() helper

Use the dev_err_probe() helper, instead of open-coding the same
operation.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20211214020843.2225831-14-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 88fb6da3
...@@ -853,8 +853,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) ...@@ -853,8 +853,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
ret = devm_snd_soc_register_card(&pdev->dev, &priv->card); ret = devm_snd_soc_register_card(&pdev->dev, &priv->card);
if (ret) { if (ret) {
if (ret != -EPROBE_DEFER) dev_err_probe(&pdev->dev, ret, "snd_soc_register_card failed\n");
dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
goto asrc_fail; goto asrc_fail;
} }
......
...@@ -563,9 +563,8 @@ static int imx_card_parse_of(struct imx_card_data *data) ...@@ -563,9 +563,8 @@ static int imx_card_parse_of(struct imx_card_data *data)
ret = snd_soc_of_get_dai_name(cpu, &link->cpus->dai_name); ret = snd_soc_of_get_dai_name(cpu, &link->cpus->dai_name);
if (ret) { if (ret) {
if (ret != -EPROBE_DEFER) dev_err_probe(card->dev, ret,
dev_err(card->dev, "%s: error getting cpu dai name: %d\n", "%s: error getting cpu dai name\n", link->name);
link->name, ret);
goto err; goto err;
} }
...@@ -573,9 +572,8 @@ static int imx_card_parse_of(struct imx_card_data *data) ...@@ -573,9 +572,8 @@ static int imx_card_parse_of(struct imx_card_data *data)
if (codec) { if (codec) {
ret = snd_soc_of_get_dai_link_codecs(dev, codec, link); ret = snd_soc_of_get_dai_link_codecs(dev, codec, link);
if (ret < 0) { if (ret < 0) {
if (ret != -EPROBE_DEFER) dev_err_probe(dev, ret, "%s: codec dai not found\n",
dev_err(dev, "%s: codec dai not found: %d\n", link->name);
link->name, ret);
goto err; goto err;
} }
...@@ -814,11 +812,8 @@ static int imx_card_probe(struct platform_device *pdev) ...@@ -814,11 +812,8 @@ static int imx_card_probe(struct platform_device *pdev)
} }
ret = devm_snd_soc_register_card(&pdev->dev, &data->card); ret = devm_snd_soc_register_card(&pdev->dev, &data->card);
if (ret) { if (ret)
if (ret != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, ret, "snd_soc_register_card failed\n");
dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
return ret;
}
return 0; return 0;
} }
......
...@@ -173,9 +173,7 @@ static int imx_sgtl5000_probe(struct platform_device *pdev) ...@@ -173,9 +173,7 @@ static int imx_sgtl5000_probe(struct platform_device *pdev)
ret = devm_snd_soc_register_card(&pdev->dev, &data->card); ret = devm_snd_soc_register_card(&pdev->dev, &data->card);
if (ret) { if (ret) {
if (ret != -EPROBE_DEFER) dev_err_probe(&pdev->dev, ret, "snd_soc_register_card failed\n");
dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n",
ret);
goto fail; goto fail;
} }
......
...@@ -70,8 +70,8 @@ static int imx_spdif_audio_probe(struct platform_device *pdev) ...@@ -70,8 +70,8 @@ static int imx_spdif_audio_probe(struct platform_device *pdev)
goto end; goto end;
ret = devm_snd_soc_register_card(&pdev->dev, &data->card); ret = devm_snd_soc_register_card(&pdev->dev, &data->card);
if (ret && ret != -EPROBE_DEFER) if (ret)
dev_err(&pdev->dev, "snd_soc_register_card failed: %d\n", ret); dev_err_probe(&pdev->dev, ret, "snd_soc_register_card failed\n");
end: end:
of_node_put(spdif_np); of_node_put(spdif_np);
......
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