aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc/host/atmel-mci.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@linaro.org>2015-06-29 10:27:46 -0700
committerKevin Hilman <khilman@linaro.org>2015-06-29 10:27:46 -0700
commit7863a65cb422a2979b89bd1d93884091464944a0 (patch)
tree4221ca69ad1bd569b5cec9aed5601bcb8bf60fe9 /drivers/mmc/host/atmel-mci.c
parent94865bf8aa24aa359903de3c858a517243e20263 (diff)
parente99d350e5ba34ef020d2f3bf585134571f1bb323 (diff)
Merge tag 'v3.14.44' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into linux-linaro-lsk-v3.14-rt
This is the 3.14.44 stable release * tag 'v3.14.44' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable: (63 commits) Linux 3.14.44 fs/binfmt_elf.c:load_elf_binary(): return -EINVAL on zero-length mappings vfs: read file_handle only once in handle_to_path drm/radeon: partially revert "fix VM_CONTEXT*_PAGE_TABLE_END_ADDR handling" drm/radeon: fix VM_CONTEXT*_PAGE_TABLE_END_ADDR handling drm/radeon: add new bonaire pci id ACPI / init: Fix the ordering of acpi_reserve_resources() sd: Disable support for 256 byte/sector disks storvsc: Set the SRB flags correctly when no data transfer is needed Input: elantech - fix semi-mt protocol for v3 HW rtlwifi: rtl8192cu: Fix kernel deadlock md/raid0: fix restore to sector variable in raid0_make_request md/raid5: don't record new size if resize_stripes fails. thermal: step_wise: Revert optimization svcrpc: fix potential GSSX_ACCEPT_SEC_CONTEXT decoding failures mm, numa: really disable NUMA balancing by default on single node machines tools/vm: fix page-flags build ARM: fix missing syscall trace exit ARM: dts: imx27: only map 4 Kbyte for fec registers mac80211: move WEP tailroom size check ...
Diffstat (limited to 'drivers/mmc/host/atmel-mci.c')
-rw-r--r--drivers/mmc/host/atmel-mci.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index 42706ea0ba85..201ce37426ab 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -1300,7 +1300,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;
clk_prepare(host->mck);
unprepare_clk = true;
@@ -1329,7 +1329,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));