Skip to content

Commit ebd4050

Browse files
Eddie Jamesstorulf
authored andcommitted
mmc: sdhci-of-aspeed: Fix clock divider calculation
When calculating the clock divider, start dividing at 2 instead of 1. The divider is divided by two at the end of the calculation, so starting at 1 may result in a divider of 0, which shouldn't happen. Signed-off-by: Eddie James <[email protected]> Reviewed-by: Andrew Jeffery <[email protected]> Acked-by: Joel Stanley <[email protected]> Acked-by: Adrian Hunter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: [email protected] # v5.4+ Signed-off-by: Ulf Hansson <[email protected]>
1 parent 11ba468 commit ebd4050

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mmc/host/sdhci-of-aspeed.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static void aspeed_sdhci_set_clock(struct sdhci_host *host, unsigned int clock)
6868
if (WARN_ON(clock > host->max_clk))
6969
clock = host->max_clk;
7070

71-
for (div = 1; div < 256; div *= 2) {
71+
for (div = 2; div < 256; div *= 2) {
7272
if ((parent / div) <= clock)
7373
break;
7474
}

0 commit comments

Comments
 (0)