diff options
author | Mark Brown <broonie@linaro.org> | 2014-11-04 07:26:42 -0500 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2014-11-10 06:40:55 -0500 |
commit | cd0cfdd2485e6252b3c69284bf09d06c4d303116 (patch) | |
tree | 423751737233fedea400b6d8d45f67ddffb60ce8 /drivers/mmc/host/sdhci-s3c.c | |
parent | ae552ab02cd556f53047959f15a5f870ab7c5ebe (diff) |
mmc: sdhci-s3c: Check if clk_set_rate() succeeds
It is possible that we may fail to set the clock rate, if we do so then
log the failure and don't bother reprogramming the IP.
Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/sdhci-s3c.c')
-rw-r--r-- | drivers/mmc/host/sdhci-s3c.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c index 0ce6eb17deaf..4f7a63213b33 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c | |||
@@ -300,6 +300,7 @@ static void sdhci_cmu_set_clock(struct sdhci_host *host, unsigned int clock) | |||
300 | struct device *dev = &ourhost->pdev->dev; | 300 | struct device *dev = &ourhost->pdev->dev; |
301 | unsigned long timeout; | 301 | unsigned long timeout; |
302 | u16 clk = 0; | 302 | u16 clk = 0; |
303 | int ret; | ||
303 | 304 | ||
304 | host->mmc->actual_clock = 0; | 305 | host->mmc->actual_clock = 0; |
305 | 306 | ||
@@ -311,7 +312,12 @@ static void sdhci_cmu_set_clock(struct sdhci_host *host, unsigned int clock) | |||
311 | 312 | ||
312 | sdhci_s3c_set_clock(host, clock); | 313 | sdhci_s3c_set_clock(host, clock); |
313 | 314 | ||
314 | clk_set_rate(ourhost->clk_bus[ourhost->cur_clk], clock); | 315 | ret = clk_set_rate(ourhost->clk_bus[ourhost->cur_clk], clock); |
316 | if (ret != 0) { | ||
317 | dev_err(dev, "%s: failed to set clock rate %uHz\n", | ||
318 | mmc_hostname(host->mmc), clock); | ||
319 | return; | ||
320 | } | ||
315 | 321 | ||
316 | clk = SDHCI_CLOCK_INT_EN; | 322 | clk = SDHCI_CLOCK_INT_EN; |
317 | sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL); | 323 | sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL); |