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

Cezary Rojewski cezary.rojewski at intel.com
Thu Sep 3 04:00:58 PDT 2026


On 9/3/2026 6:52 AM, phucduc.bui at 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(-)

> @@ -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 at intel.com>





More information about the linux-arm-kernel mailing list