diff --git a/drivers/mmc/host/bcm2835-sdhost.c b/drivers/mmc/host/bcm2835-sdhost.c index 9c6f199a78309..6c0dafe6c64b0 100644 --- a/drivers/mmc/host/bcm2835-sdhost.c +++ b/drivers/mmc/host/bcm2835-sdhost.c @@ -1519,8 +1519,7 @@ void bcm2835_sdhost_set_clock(struct bcm2835_host *host, unsigned int clock) if (host->debug) pr_info("%s: set_clock(%d)\n", mmc_hostname(host->mmc), clock); - if ((host->overclock_50 > 50) && - (clock == 50*MHZ)) + if (host->overclock_50 && (clock == 50*MHZ)) clock = host->overclock_50 * MHZ + (MHZ - 1); /* The SDCDIV register has 11 bits, and holds (div - 2). @@ -1894,7 +1893,8 @@ int bcm2835_sdhost_add_host(struct bcm2835_host *host) mmc = host->mmc; - mmc->f_max = host->max_clk; + if (!mmc->f_max || mmc->f_max > host->max_clk) + mmc->f_max = host->max_clk; mmc->f_min = host->max_clk / SDCDIV_MAX_CDIV; mmc->max_busy_timeout = (~(unsigned int)0)/(mmc->f_max/1000);