Commit 97793a81 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'mmc-4.1-rc3' of git://git.linaro.org/people/ulf.hansson/mmc

Pull MMC fix from Ulf Hansson:
 "One more mmc fix intended for v4.1 rc5:

  MMC host:
   - atmel-mci: fix bad variable type for clkdiv"

* tag 'mmc-4.1-rc3' of git://git.linaro.org/people/ulf.hansson/mmc:
  mmc: atmel-mci: fix bad variable type for clkdiv
parents 6efdb114 60c8f783
......@@ -1304,7 +1304,7 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
if (ios->clock) {
unsigned int clock_min = ~0U;
u32 clkdiv;
int clkdiv;
spin_lock_bh(&host->lock);
if (!host->mode_reg) {
......@@ -1328,7 +1328,12 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
/* Calculate clock divider */
if (host->caps.has_odd_clk_div) {
clkdiv = DIV_ROUND_UP(host->bus_hz, clock_min) - 2;
if (clkdiv > 511) {
if (clkdiv < 0) {
dev_warn(&mmc->class_dev,
"clock %u too fast; using %lu\n",
clock_min, host->bus_hz / 2);
clkdiv = 0;
} else if (clkdiv > 511) {
dev_warn(&mmc->class_dev,
"clock %u too slow; using %lu\n",
clock_min, host->bus_hz / (511 + 2));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment