Skip to content

Commit ce473d5

Browse files
Michał Zeganstorulf
authored andcommitted
mmc: meson-gx: fix error path when driver initialization fails before enabling clocks
This patch fixes the case where meson_mmc_probe function fails before core_clk is enabled. Originally, that would result in a try to disable the core clock, and if it was not already enabled, it would result in a kernel warning. This issue is similar to the one with div_clk. Fix it by introducing another error path used only between successfully enabling the core clock, and successfully enabling the div clock. That would ensure that core clock is disabled only if it was enabled before. Signed-off-by: Michał Zegan <webczat@webczatnet.pl> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent e8ce674 commit ce473d5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/mmc/host/meson-gx-mmc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ static int meson_mmc_probe(struct platform_device *pdev)
743743

744744
ret = meson_mmc_clk_init(host);
745745
if (ret)
746-
goto free_host;
746+
goto err_core_clk;
747747

748748
/* Stop execution */
749749
writel(0, host->regs + SD_EMMC_START);
@@ -783,8 +783,9 @@ static int meson_mmc_probe(struct platform_device *pdev)
783783

784784
err_div_clk:
785785
clk_disable_unprepare(host->cfg_div_clk);
786-
free_host:
786+
err_core_clk:
787787
clk_disable_unprepare(host->core_clk);
788+
free_host:
788789
mmc_free_host(mmc);
789790
return ret;
790791
}

0 commit comments

Comments
 (0)