[RFC PATCH v2 4/4] mmc: sdhci-cadence: fix the return value of sdhci_cdns_get_timeout_clock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Return the timeout clock rate in Hz for sdhci core.

Signed-off-by: Shawn Lin <shawn.lin@xxxxxxxxxxxxxx>
---

Changes in v2: None

 drivers/mmc/host/sdhci-cadence.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-cadence.c b/drivers/mmc/host/sdhci-cadence.c
index 316cfec..bb3951a 100644
--- a/drivers/mmc/host/sdhci-cadence.c
+++ b/drivers/mmc/host/sdhci-cadence.c
@@ -103,9 +103,10 @@ static unsigned int sdhci_cdns_get_timeout_clock(struct sdhci_host *host)
 {
 	/*
 	 * Cadence's spec says the Timeout Clock Frequency is the same as the
-	 * Base Clock Frequency.  Divide it by 1000 to return a value in kHz.
+	 * Base Clock Frequency. Return a value in Hz per the requirement of
+	 * .get_timeout_clock callback.
 	 */
-	return host->max_clk / 1000;
+	return DIV_ROUND_UP(DIV_ROUND_UP(host->max_clk, 1000), 1000);
 }
 
 static void sdhci_cdns_set_uhs_signaling(struct sdhci_host *host,
-- 
1.9.1


--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux