summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSahitya Tummala <stummala@codeaurora.org>2011-05-02 14:37:01 +0200
committerChris Ball <cjb@laptop.org>2011-10-26 21:43:37 +0200
commit514d9eda92654430369060b91f7472bb198e7904 (patch)
treedb764616b3b37645f8be568693ad1a2073e9b6e1
parentmmc: msm_sdcc: Handle error cases in probe (diff)
downloadlinux-514d9eda92654430369060b91f7472bb198e7904.tar.xz
linux-514d9eda92654430369060b91f7472bb198e7904.zip
mmc: msm_sdcc: Enable SDC host->clk only after setting the rate.
For clocks that support rates which can be set (most clocks other than _pclk AHB clocks), a rate must be set using clk_set_rate() before the clock is enabled for the first time with clk_enable(). Subsequent calls to clk_enable() need not be preceded with the clk_set_rate() calls unless we wish to change the clock rate that is set previously. SDC host->clk is currently enabled without setting the clock rate even once. This patch fixes this, by ensuring that the clock rate for this clock is first set before enabling the clock. Signed-off-by: Murali Palnati <palnatim@codeaurora.org> Signed-off-by: Sahitya Tummala <stummala@codeaurora.org> Signed-off-by: David Brown <davidb@codeaurora.org> Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r--drivers/mmc/host/msm_sdcc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index 0f0b4fdb62ab..de00001a5349 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -1247,17 +1247,17 @@ msmsdcc_probe(struct platform_device *pdev)
goto pclk_put;
}
- /* Enable clocks */
- ret = msmsdcc_enable_clocks(host);
- if (ret)
- goto clk_put;
-
ret = clk_set_rate(host->clk, msmsdcc_fmin);
if (ret) {
pr_err("%s: Clock rate set failed (%d)\n", __func__, ret);
- goto clk_disable;
+ goto clk_put;
}
+ /* Enable clocks */
+ ret = msmsdcc_enable_clocks(host);
+ if (ret)
+ goto clk_put;
+
host->pclk_rate = clk_get_rate(host->pclk);
host->clk_rate = clk_get_rate(host->clk);