Skip to content

Commit bc3cbc0

Browse files
AngeloGioacchino Del RegnoChun-Kuang Hu
authored andcommitted
drm/mediatek: mtk_hdmi: Remove goto in mtk_hdmi_clk_enable_audio()
If the clk_prepare_enable() call for the SPDIF clock fails, just disable and unprepare the clock in the error check branch and return immediately instead of jumping to the end with a goto, slightly reducing code size. This commit brings no functional changes. Reviewed-by: CK Hu <[email protected]> Signed-off-by: AngeloGioacchino Del Regno <[email protected]> Link: https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/ Signed-off-by: Chun-Kuang Hu <[email protected]>
1 parent 900f5b3 commit bc3cbc0

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/gpu/drm/mediatek/mtk_hdmi.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,13 +1159,12 @@ static int mtk_hdmi_clk_enable_audio(struct mtk_hdmi *hdmi)
11591159
return ret;
11601160

11611161
ret = clk_prepare_enable(hdmi->clk[MTK_HDMI_CLK_AUD_SPDIF]);
1162-
if (ret)
1163-
goto err;
1162+
if (ret) {
1163+
clk_disable_unprepare(hdmi->clk[MTK_HDMI_CLK_AUD_BCLK]);
1164+
return ret;
1165+
}
11641166

11651167
return 0;
1166-
err:
1167-
clk_disable_unprepare(hdmi->clk[MTK_HDMI_CLK_AUD_BCLK]);
1168-
return ret;
11691168
}
11701169

11711170
static void mtk_hdmi_clk_disable_audio(struct mtk_hdmi *hdmi)

0 commit comments

Comments
 (0)