aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2012-08-22 11:10:01 -0400
committerChris Ball <cjb@laptop.org>2012-09-04 13:58:06 -0400
commit74f330bceaa7b88d06062e1cac3d519a3dfc041e (patch)
tree52fa68bec236d867c19a92fcb159180ec2b311bd
parentfc108d24d3a6da63576a460e122fa1df0cbdea20 (diff)
mmc: sdhci-esdhc: break out early if clock is 0
Since commit 30832ab56 ("mmc: sdhci: Always pass clock request value zero to set_clock host op") was merged, esdhc_set_clock starts hitting "if (clock == 0)" where ESDHC_SYSTEM_CONTROL has been operated. This causes SDHCI card-detection function being broken. Fix the regression by moving "if (clock == 0)" above ESDHC_SYSTEM_CONTROL operation. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Cc: <stable@vger.kernel.org> Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r--drivers/mmc/host/sdhci-esdhc.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mmc/host/sdhci-esdhc.h b/drivers/mmc/host/sdhci-esdhc.h
index b97b2f5dafdb..d25f9ab9a54d 100644
--- a/drivers/mmc/host/sdhci-esdhc.h
+++ b/drivers/mmc/host/sdhci-esdhc.h
@@ -48,14 +48,14 @@ static inline void esdhc_set_clock(struct sdhci_host *host, unsigned int clock)
48 int div = 1; 48 int div = 1;
49 u32 temp; 49 u32 temp;
50 50
51 if (clock == 0)
52 goto out;
53
51 temp = sdhci_readl(host, ESDHC_SYSTEM_CONTROL); 54 temp = sdhci_readl(host, ESDHC_SYSTEM_CONTROL);
52 temp &= ~(ESDHC_CLOCK_IPGEN | ESDHC_CLOCK_HCKEN | ESDHC_CLOCK_PEREN 55 temp &= ~(ESDHC_CLOCK_IPGEN | ESDHC_CLOCK_HCKEN | ESDHC_CLOCK_PEREN
53 | ESDHC_CLOCK_MASK); 56 | ESDHC_CLOCK_MASK);
54 sdhci_writel(host, temp, ESDHC_SYSTEM_CONTROL); 57 sdhci_writel(host, temp, ESDHC_SYSTEM_CONTROL);
55 58
56 if (clock == 0)
57 goto out;
58
59 while (host->max_clk / pre_div / 16 > clock && pre_div < 256) 59 while (host->max_clk / pre_div / 16 > clock && pre_div < 256)
60 pre_div *= 2; 60 pre_div *= 2;
61 61