Thread (7 messages) flat view 7 messages, 2 authors, 11d ago

Re: [PATCH v4 2/5] ASoC: mediatek: mt8183: Fix clock handling in mux disable path

From: Cezary Rojewski <cezary.rojewski@intel.com>
Date: 2026-09-03 11:01:24
Also in: linux-mediatek, linux-sound, lkml

On 9/3/2026 6:52 AM, phucduc.bui@gmail.com wrote:
Changes in v4:
 - In the mux disable path, remove the goto labels so that all teardown
   steps are attempted and any errors are only reported.

 sound/soc/mediatek/mt8183/mt8183-afe-clk.c | 6 ------
 1 file changed, 6 deletions(-)
quoted hunk ↗ jump to hunk
@@ -271,7 +271,6 @@ static int apll1_mux_setting(struct mtk_base_afe *afe, bool enable)
 			dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
 				__func__, aud_clks[CLK_TOP_MUX_AUD_ENG1],
 				aud_clks[CLK_CLK26M], ret);
-			goto EXIT;
 		}
 		clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_ENG1]);
 
@@ -281,7 +280,6 @@ static int apll1_mux_setting(struct mtk_base_afe *afe, bool enable)
 			dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n",
 				__func__, aud_clks[CLK_TOP_MUX_AUD_1],
 				aud_clks[CLK_CLK26M], ret);
-			goto EXIT;
 		}
 		clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_1]);
 	}
@@ -298,7 +296,6 @@ static int apll1_mux_setting(struct mtk_base_afe *afe, bool enable)
 		       afe_priv->clk[CLK_CLK26M]);
 	clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_1]);
 ERR_ENABLE_CLK_TOP_MUX_AUD_1:
-EXIT:
 	return ret;
 }
When looking at this again, I'd probably refactor the whole thing so we
have a permissive teardown path but still propagate the error code in
case there is a caller who does care about the result of the disable
scenario.  Alas, nothing in this file ever checks the results of
apll1/2_mux_setting() so the callers needed an update too.  Well, let's
just say that's a tale for a separate patchset..


TLDR: the patch is still an improvement and the (possible) refactor is a
outside of its scope.

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help