summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2019-05-08 18:15:33 +0800
committerPeng Fan <peng.fan@nxp.com>2019-05-08 18:24:54 +0800
commit94ec725e440da10c04b5e7f1c9e59b47112c1dd0 (patch)
tree2de977cf97b73256ea818d173ff447f89b1940dd /drivers
parent78ca8fbe3ec2631eb4b10d64c20bd3df840dd91a (diff)
MLK-21354-2 mmc: fsl_esdhc: fix pre_div
We have initialized pre_div, so no need to override it. And it will break those have pre_div initialized as 2. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Ye Li <ye.li@nxp.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/fsl_esdhc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index cb454d55b1..08c1cdb027 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -6,6 +6,8 @@
* (C) Copyright 2003
* Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
*
+ * Copyright 2019 NXP
+ *
* SPDX-License-Identifier: GPL-2.0+
*/
@@ -611,8 +613,7 @@ static void set_sysctl(struct fsl_esdhc_priv *priv, struct mmc *mmc, uint clock)
for (; pre_div < 256; pre_div *= 2)
if ((sdhc_clk / pre_div) <= (clock * 16))
break;
- } else
- pre_div = 1;
+ }
for (div = 1; div <= 16; div++)
if ((sdhc_clk / (div * pre_div)) <= clock)