Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65be3fef authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Chris Ball
Browse files

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 272308ca
Loading
Loading
Loading
Loading
+2 −5
Original line number Original line Diff line number Diff line
@@ -2505,11 +2505,8 @@ int sdhci_add_host(struct sdhci_host *host)
		host->timeout_clk *= 1000;
		host->timeout_clk *= 1000;


	if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK)
	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;
	mmc->caps |= MMC_CAP_SDIO_IRQ | MMC_CAP_ERASE | MMC_CAP_CMD23;