Commit a11937b3 authored by Liming Sun's avatar Liming Sun Committed by Ulf Hansson

mmc: sdhci-of-dwcmshc: Add error handling in dwcmshc_resume

This commit adds handling in dwcmshc_resume() for different error
cases.
Signed-off-by: default avatarLiming Sun <limings@nvidia.com>
Acked-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20230822195929.168552-1-limings@nvidia.comSigned-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 5ae4b0d8
......@@ -630,17 +630,32 @@ static int dwcmshc_resume(struct device *dev)
if (!IS_ERR(priv->bus_clk)) {
ret = clk_prepare_enable(priv->bus_clk);
if (ret)
return ret;
goto disable_clk;
}
if (rk_priv) {
ret = clk_bulk_prepare_enable(RK35xx_MAX_CLKS,
rk_priv->rockchip_clks);
if (ret)
return ret;
goto disable_bus_clk;
}
return sdhci_resume_host(host);
ret = sdhci_resume_host(host);
if (ret)
goto disable_rockchip_clks;
return 0;
disable_rockchip_clks:
if (rk_priv)
clk_bulk_disable_unprepare(RK35xx_MAX_CLKS,
rk_priv->rockchip_clks);
disable_bus_clk:
if (!IS_ERR(priv->bus_clk))
clk_disable_unprepare(priv->bus_clk);
disable_clk:
clk_disable_unprepare(pltfm_host->clk);
return ret;
}
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment