Skip to content

Commit a11937b

Browse files
lsun100storulf
authored andcommitted
mmc: sdhci-of-dwcmshc: Add error handling in dwcmshc_resume
This commit adds handling in dwcmshc_resume() for different error cases. Signed-off-by: Liming Sun <[email protected]> Acked-by: Adrian Hunter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent 5ae4b0d commit a11937b

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

drivers/mmc/host/sdhci-of-dwcmshc.c

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -630,17 +630,32 @@ static int dwcmshc_resume(struct device *dev)
630630
if (!IS_ERR(priv->bus_clk)) {
631631
ret = clk_prepare_enable(priv->bus_clk);
632632
if (ret)
633-
return ret;
633+
goto disable_clk;
634634
}
635635

636636
if (rk_priv) {
637637
ret = clk_bulk_prepare_enable(RK35xx_MAX_CLKS,
638638
rk_priv->rockchip_clks);
639639
if (ret)
640-
return ret;
640+
goto disable_bus_clk;
641641
}
642642

643-
return sdhci_resume_host(host);
643+
ret = sdhci_resume_host(host);
644+
if (ret)
645+
goto disable_rockchip_clks;
646+
647+
return 0;
648+
649+
disable_rockchip_clks:
650+
if (rk_priv)
651+
clk_bulk_disable_unprepare(RK35xx_MAX_CLKS,
652+
rk_priv->rockchip_clks);
653+
disable_bus_clk:
654+
if (!IS_ERR(priv->bus_clk))
655+
clk_disable_unprepare(priv->bus_clk);
656+
disable_clk:
657+
clk_disable_unprepare(pltfm_host->clk);
658+
return ret;
644659
}
645660
#endif
646661

0 commit comments

Comments
 (0)