diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2012-08-22 23:10:01 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-02 09:47:24 -0700 |
commit | 0afe8813641fda8e31a24add2f753488a8dd7c8a (patch) | |
tree | 1ff55f3c3982b9c75d6c421a660791b2f2bffc5c | |
parent | 2df2bfdbb4136e7051d12787dd2966cffc2a0eaa (diff) | |
download | kernel_samsung_smdk4412-0afe8813641fda8e31a24add2f753488a8dd7c8a.zip kernel_samsung_smdk4412-0afe8813641fda8e31a24add2f753488a8dd7c8a.tar.gz kernel_samsung_smdk4412-0afe8813641fda8e31a24add2f753488a8dd7c8a.tar.bz2 |
mmc: sdhci-esdhc: break out early if clock is 0
commit 74f330bceaa7b88d06062e1cac3d519a3dfc041e upstream.
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>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/mmc/host/sdhci-esdhc.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mmc/host/sdhci-esdhc.h b/drivers/mmc/host/sdhci-esdhc.h index c3b08f1..62ca03a 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) int div = 1; u32 temp; + if (clock == 0) + goto out; + temp = sdhci_readl(host, ESDHC_SYSTEM_CONTROL); temp &= ~(ESDHC_CLOCK_IPGEN | ESDHC_CLOCK_HCKEN | ESDHC_CLOCK_PEREN | ESDHC_CLOCK_MASK); sdhci_writel(host, temp, ESDHC_SYSTEM_CONTROL); - if (clock == 0) - goto out; - while (host->max_clk / pre_div / 16 > clock && pre_div < 256) pre_div *= 2; |