[PATCH 1/7] ASoC: mediatek: mt8188: mt8188-afe-clk: Propagate clock initialization errors
From: phucduc . bui
Date: Mon Sep 07 2026 - 08:13:40 EST
From: bui duc phuc <phucduc.bui@xxxxxxxxx>
Use dev_err_probe() to handle clock lookup errors without printing
redundant messages for deferred probe.
Propagate the original error from tuner initialization instead of
returning -EINVAL.
Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
sound/soc/mediatek/mt8188/mt8188-afe-clk.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/sound/soc/mediatek/mt8188/mt8188-afe-clk.c b/sound/soc/mediatek/mt8188/mt8188-afe-clk.c
index fc6cb3f0469e..42878c8a6529 100644
--- a/sound/soc/mediatek/mt8188/mt8188-afe-clk.c
+++ b/sound/soc/mediatek/mt8188/mt8188-afe-clk.c
@@ -416,12 +416,9 @@ int mt8188_afe_init_clock(struct mtk_base_afe *afe)
for (i = 0; i < MT8188_CLK_NUM; i++) {
afe_priv->clk[i] = devm_clk_get(afe->dev, aud_clks[i]);
- if (IS_ERR(afe_priv->clk[i])) {
- dev_err(afe->dev, "%s(), devm_clk_get %s fail, ret %ld\n",
- __func__, aud_clks[i],
- PTR_ERR(afe_priv->clk[i]));
- return PTR_ERR(afe_priv->clk[i]);
- }
+ if (IS_ERR(afe_priv->clk[i]))
+ return dev_err_probe(afe->dev, PTR_ERR(afe_priv->clk[i]),
+ "failed to get clock %s\n", aud_clks[i]);
}
/* initial tuner */
@@ -430,7 +427,7 @@ int mt8188_afe_init_clock(struct mtk_base_afe *afe)
if (ret) {
dev_info(afe->dev, "%s(), init apll_tuner%d failed",
__func__, (i + 1));
- return -EINVAL;
+ return ret;
}
}
--
2.43.0