ASoC: fsl: Use dev_err_probe() helper

Use the dev_err_probe() helper, instead of open-coding the same
operation.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20211214020843.2225831-14-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Kuninori Morimoto 2021-12-14 11:08:34 +09:00 committed by Mark Brown
parent 88fb6da3f4
commit 2e6f557ca3
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
4 changed files with 10 additions and 18 deletions

View File

@ -853,8 +853,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
ret = devm_snd_soc_register_card(&pdev->dev, &priv->card);
if (ret) {
if (ret != -EPROBE_DEFER)
dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
dev_err_probe(&pdev->dev, ret, "snd_soc_register_card failed\n");
goto asrc_fail;
}

View File

@ -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);
if (ret) {
if (ret != -EPROBE_DEFER)
dev_err(card->dev, "%s: error getting cpu dai name: %d\n",
link->name, ret);
dev_err_probe(card->dev, ret,
"%s: error getting cpu dai name\n", link->name);
goto err;
}
@ -573,9 +572,8 @@ static int imx_card_parse_of(struct imx_card_data *data)
if (codec) {
ret = snd_soc_of_get_dai_link_codecs(dev, codec, link);
if (ret < 0) {
if (ret != -EPROBE_DEFER)
dev_err(dev, "%s: codec dai not found: %d\n",
link->name, ret);
dev_err_probe(dev, ret, "%s: codec dai not found\n",
link->name);
goto err;
}
@ -814,11 +812,8 @@ static int imx_card_probe(struct platform_device *pdev)
}
ret = devm_snd_soc_register_card(&pdev->dev, &data->card);
if (ret) {
if (ret != -EPROBE_DEFER)
dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
return ret;
}
if (ret)
return dev_err_probe(&pdev->dev, ret, "snd_soc_register_card failed\n");
return 0;
}

View File

@ -173,9 +173,7 @@ static int imx_sgtl5000_probe(struct platform_device *pdev)
ret = devm_snd_soc_register_card(&pdev->dev, &data->card);
if (ret) {
if (ret != -EPROBE_DEFER)
dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n",
ret);
dev_err_probe(&pdev->dev, ret, "snd_soc_register_card failed\n");
goto fail;
}

View File

@ -70,8 +70,8 @@ static int imx_spdif_audio_probe(struct platform_device *pdev)
goto end;
ret = devm_snd_soc_register_card(&pdev->dev, &data->card);
if (ret && ret != -EPROBE_DEFER)
dev_err(&pdev->dev, "snd_soc_register_card failed: %d\n", ret);
if (ret)
dev_err_probe(&pdev->dev, ret, "snd_soc_register_card failed\n");
end:
of_node_put(spdif_np);