Skip to content

Commit

Permalink
mmc: sdhci: use f_max instead of host->clock for timeouts
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
andy-shev authored and cjb committed Aug 13, 2011
1 parent 272308c commit 65be3fe
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/mmc/host/sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 65be3fe

Please sign in to comment.