[PATCH v4 3/4] mmc: sdhci-of-arasan: fix clk prepare and unprepare for PM callback

From: Shawn Lin
Date: Wed Oct 21 2015 - 23:38:50 EST


This patch use clk_prepare_enable and clk_disable_unprepare for
system PM callback instead of directly use clk_enable and clk_disable
without clk_prepare/unprepare.

Signed-off-by: Shawn Lin <shawn.lin@xxxxxxxxxxxxxx>
---

Changes in v2: None

drivers/mmc/host/sdhci-of-arasan.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
index 4f30716..2d327d4 100644
--- a/drivers/mmc/host/sdhci-of-arasan.c
+++ b/drivers/mmc/host/sdhci-of-arasan.c
@@ -99,8 +99,8 @@ static int sdhci_arasan_suspend(struct device *dev)
}
}

- clk_disable(pltfm_host->clk);
- clk_disable(sdhci_arasan->clk_ahb);
+ clk_disable_unprepare(pltfm_host->clk);
+ clk_disable_unprepare(sdhci_arasan->clk_ahb);

return 0;
}
@@ -120,13 +120,13 @@ static int sdhci_arasan_resume(struct device *dev)
struct sdhci_arasan_data *sdhci_arasan = pltfm_host->priv;
int ret;

- ret = clk_enable(sdhci_arasan->clk_ahb);
+ ret = clk_prepare_enable(sdhci_arasan->clk_ahb);
if (ret) {
dev_err(dev, "Cannot enable AHB clock.\n");
return ret;
}

- ret = clk_enable(pltfm_host->clk);
+ ret = clk_prepare_enable(pltfm_host->clk);
if (ret) {
dev_err(dev, "Cannot enable SD clock.\n");
goto err_clk_en;
@@ -143,9 +143,9 @@ static int sdhci_arasan_resume(struct device *dev)
return sdhci_resume_host(host);

err_phy_power:
- clk_disable(pltfm_host->clk);
+ clk_disable_unprepare(pltfm_host->clk);
err_clk_en:
- clk_disable(sdhci_arasan->clk_ahb);
+ clk_disable_unprepare(sdhci_arasan->clk_ahb);
return ret;
}
#endif /* ! CONFIG_PM_SLEEP */
--
2.3.7


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/