mirror of
https://github.com/torvalds/linux.git
synced 2026-09-14 16:10:02 +02:00
ASoC: mxs: Improve probe error handling
bui duc phuc <phucduc.bui@gmail.com> says: This series improves probe error handling in the MXS ASoC drivers. Use dev_err_probe() where appropriate and remove redundant dev_err() calls when the corresponding errors are already reported by the called functions or further down the call chain. Compile-tested only. Link: https://patch.msgid.link/20260812101418.37966-1-phucduc.bui@gmail.com
This commit is contained in:
commit
f5360c8a83
|
|
@ -826,12 +826,9 @@ static int mxs_saif_probe(struct platform_device *pdev)
|
|||
mxs_saif[saif->id] = saif;
|
||||
|
||||
saif->clk = devm_clk_get(&pdev->dev, NULL);
|
||||
if (IS_ERR(saif->clk)) {
|
||||
ret = PTR_ERR(saif->clk);
|
||||
dev_err(&pdev->dev, "Cannot get the clock: %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
if (IS_ERR(saif->clk))
|
||||
return dev_err_probe(&pdev->dev, PTR_ERR(saif->clk),
|
||||
"Cannot get the clock\n");
|
||||
|
||||
saif->base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(saif->base))
|
||||
|
|
@ -844,10 +841,8 @@ static int mxs_saif_probe(struct platform_device *pdev)
|
|||
saif->dev = &pdev->dev;
|
||||
ret = devm_request_irq(&pdev->dev, irq, mxs_saif_irq, 0,
|
||||
dev_name(&pdev->dev), saif);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed to request irq\n");
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
platform_set_drvdata(pdev, saif);
|
||||
|
||||
|
|
@ -860,16 +855,12 @@ static int mxs_saif_probe(struct platform_device *pdev)
|
|||
|
||||
ret = devm_snd_soc_register_component(&pdev->dev, &mxs_saif_component,
|
||||
&mxs_saif_dai, 1);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "register DAI failed\n");
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = mxs_pcm_platform_register(&pdev->dev);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "register PCM failed: %d\n", ret);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -155,8 +155,6 @@ static int mxs_sgtl5000_probe(struct platform_device *pdev)
|
|||
|
||||
ret = snd_soc_of_parse_audio_routing(card, "audio-routing");
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed to parse audio-routing (%d)\n",
|
||||
ret);
|
||||
mxs_saif_put_mclk(0);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user