lkml.org 
[lkml]   [2015]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v4 3/4] mmc: sdhci-of-arasan: fix clk prepare and unprepare for PM callback
Date
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@rock-chips.com>
---

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



\
 
 \ /
  Last update: 2015-10-22 05:41    [W:0.047 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site