Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH] ASoC: mediatek: mt8188: Add error handling in mtk_dai_etdm_enable_mclk
@ 2024-11-22  5:52 Zhu Jun
  2024-11-22 10:52 ` Markus Elfring
  0 siblings, 1 reply; 2+ messages in thread
From: Zhu Jun @ 2024-11-22  5:52 UTC (permalink / raw)
  To: perex
  Cc: tiwai, matthias.bgg, zhujun2, linux-sound, linux-kernel,
	linux-arm-kernel, linux-mediatek

Introduce error handling in mtk_dai_etdm_enable_mclk to ensure that
the function returns immediately if mt8188_afe_set_clk_rate fails.

Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
---
 sound/soc/mediatek/mt8188/mt8188-dai-etdm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/mediatek/mt8188/mt8188-dai-etdm.c b/sound/soc/mediatek/mt8188/mt8188-dai-etdm.c
index 69a091dad..bd325dc71 100644
--- a/sound/soc/mediatek/mt8188/mt8188-dai-etdm.c
+++ b/sound/soc/mediatek/mt8188/mt8188-dai-etdm.c
@@ -430,6 +430,8 @@ static int mtk_dai_etdm_enable_mclk(struct mtk_base_afe *afe, int dai_id)
 	/* set rate */
 	ret = mt8188_afe_set_clk_rate(afe, afe_priv->clk[clkdiv_id],
 				      etdm_data->mclk_freq);
+	if (ret)
+		return ret;
 
 	mt8188_afe_enable_clk(afe, afe_priv->clk[clkdiv_id]);
 
-- 
2.17.1




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-22 10:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-22  5:52 [PATCH] ASoC: mediatek: mt8188: Add error handling in mtk_dai_etdm_enable_mclk Zhu Jun
2024-11-22 10:52 ` Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox