diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2011-08-03 18:36:01 +0300 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-08-13 14:50:30 -0400 |
commit | 65be3fef930beb3e282e7f23dfba63289971430c (patch) | |
tree | a2d74efe845f8c90e828b775d59eaaf134533bac /drivers/mmc/host | |
parent | 272308caaa6c0f2b1500a3660b9fa75f17a45cc4 (diff) |
mmc: sdhci: use f_max instead of host->clock for timeouts
When timeout_clk is calculated the host->clock could be zero.
So, instead of host->clock the calculation now uses mmc->f_max.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r-- | drivers/mmc/host/sdhci.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index afa26bdcfa4..0e02cc1df12 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2505,12 +2505,9 @@ int sdhci_add_host(struct sdhci_host *host) host->timeout_clk *= 1000; if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK) - host->timeout_clk = host->clock / 1000; + host->timeout_clk = mmc->f_max / 1000; - if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK) - mmc->max_discard_to = (1 << 27) / (mmc->f_max / 1000); - else - mmc->max_discard_to = (1 << 27) / host->timeout_clk; + mmc->max_discard_to = (1 << 27) / host->timeout_clk; mmc->caps |= MMC_CAP_SDIO_IRQ | MMC_CAP_ERASE | MMC_CAP_CMD23; |