Skip to content

Commit c61bfb1

Browse files
gscuiUlf Hansson
authored andcommitted
mmc: mtk-sd: Fix missing clk_disable_unprepare in msdc_of_clock_parse()
The clk_disable_unprepare() should be called in the error handling of devm_clk_bulk_get_optional, fix it by replacing devm_clk_get_optional and clk_prepare_enable by devm_clk_get_optional_enabled. Fixes: f5eccd9 ("mmc: mediatek: Add subsys clock control for MT8192 msdc") Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221125090141.3626747-1-cuigaosheng1@huawei.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent f4307b4 commit c61bfb1

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/mmc/host/mtk-sd.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2588,13 +2588,11 @@ static int msdc_of_clock_parse(struct platform_device *pdev,
25882588
return PTR_ERR(host->src_clk_cg);
25892589
}
25902590

2591-
host->sys_clk_cg = devm_clk_get_optional(&pdev->dev, "sys_cg");
2591+
/* If present, always enable for this clock gate */
2592+
host->sys_clk_cg = devm_clk_get_optional_enabled(&pdev->dev, "sys_cg");
25922593
if (IS_ERR(host->sys_clk_cg))
25932594
host->sys_clk_cg = NULL;
25942595

2595-
/* If present, always enable for this clock gate */
2596-
clk_prepare_enable(host->sys_clk_cg);
2597-
25982596
host->bulk_clks[0].id = "pclk_cg";
25992597
host->bulk_clks[1].id = "axi_cg";
26002598
host->bulk_clks[2].id = "ahb_cg";

0 commit comments

Comments
 (0)