[PATCH 2/5] ASoC: kirkwood: kirkwood-i2s: Improve error handling in probe

From: phucduc . bui

Date: Mon Oct 26 2026 - 07:01:46 EST


From: bui duc phuc <phucduc.bui@xxxxxxxxx>

Use dev_err_probe() to report clock acquisition errors.

Remove the redundant error message when snd_soc_register_component()
fails. The errors handled here are already reported deeper in the
call chain, so the additional dev_err() call is unnecessary.

Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
sound/soc/kirkwood/kirkwood-i2s.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c
index cf4327101b96..29641bd4cc60 100644
--- a/sound/soc/kirkwood/kirkwood-i2s.c
+++ b/sound/soc/kirkwood/kirkwood-i2s.c
@@ -687,10 +687,9 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
}

priv->clk = devm_clk_get(&pdev->dev, np ? "internal" : NULL);
- if (IS_ERR(priv->clk)) {
- dev_err(&pdev->dev, "no clock\n");
- return PTR_ERR(priv->clk);
- }
+ if (IS_ERR(priv->clk))
+ return dev_err_probe(&pdev->dev, PTR_ERR(priv->clk),
+ "no clock\n");

priv->extclk = devm_clk_get(&pdev->dev, "extclk");
if (IS_ERR(priv->extclk)) {
@@ -726,10 +725,8 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)

err = snd_soc_register_component(&pdev->dev, &kirkwood_soc_component,
soc_dai, 2);
- if (err) {
- dev_err(&pdev->dev, "snd_soc_register_component failed\n");
+ if (err)
goto err_component;
- }

kirkwood_i2s_init(priv);

--
2.43.0