summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-07-29 17:35:22 (GMT)
committerJaehoon Chung <jh80.chung@samsung.com>2017-08-17 07:44:17 (GMT)
commitd6eb25e9878617f9a1d7f06ec21c9b981bb0a4e5 (patch)
tree4ba328d13c4cf15debdd35b11538b4c765680907 /drivers/mmc
parente88e1d9c048671d6fd896318dab2484b4ecb1da3 (diff)
downloadu-boot-d6eb25e9878617f9a1d7f06ec21c9b981bb0a4e5.tar.xz
dm: mmc: fsl_esdhc: Drop mmc_init() call from fsl_esdhc_init()
We want to use fsl_esdhc_init() with driver model. Move the mmc_init() out of this function so that we can use it for our common init. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/fsl_esdhc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index bb6fac2..662824f 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -765,7 +765,6 @@ static int fsl_esdhc_init(struct fsl_esdhc_priv *priv,
{
struct mmc_config *cfg;
struct fsl_esdhc *regs;
- struct mmc *mmc;
u32 caps, voltage_caps;
int ret;
@@ -856,12 +855,6 @@ static int fsl_esdhc_init(struct fsl_esdhc_priv *priv,
cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
- mmc = mmc_create(cfg, priv);
- if (mmc == NULL)
- return -1;
-
- priv->mmc = mmc;
-
return 0;
}
@@ -885,6 +878,7 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg)
{
struct fsl_esdhc_plat *plat;
struct fsl_esdhc_priv *priv;
+ struct mmc *mmc;
int ret;
if (!cfg)
@@ -915,6 +909,12 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg)
return ret;
}
+ mmc = mmc_create(&plat->cfg, priv);
+ if (!mmc)
+ return -EIO;
+
+ priv->mmc = mmc;
+
return 0;
}