Skip to content
Snippets Groups Projects
Commit d6eb25e9 authored by Simon Glass's avatar Simon Glass Committed by Jaehoon Chung
Browse files

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: default avatarSimon Glass <sjg@chromium.org>
parent e88e1d9c
No related branches found
No related tags found
No related merge requests found
...@@ -765,7 +765,6 @@ static int fsl_esdhc_init(struct fsl_esdhc_priv *priv, ...@@ -765,7 +765,6 @@ static int fsl_esdhc_init(struct fsl_esdhc_priv *priv,
{ {
struct mmc_config *cfg; struct mmc_config *cfg;
struct fsl_esdhc *regs; struct fsl_esdhc *regs;
struct mmc *mmc;
u32 caps, voltage_caps; u32 caps, voltage_caps;
int ret; int ret;
...@@ -856,12 +855,6 @@ static int fsl_esdhc_init(struct fsl_esdhc_priv *priv, ...@@ -856,12 +855,6 @@ static int fsl_esdhc_init(struct fsl_esdhc_priv *priv,
cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT; cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
mmc = mmc_create(cfg, priv);
if (mmc == NULL)
return -1;
priv->mmc = mmc;
return 0; return 0;
} }
...@@ -885,6 +878,7 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg) ...@@ -885,6 +878,7 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg)
{ {
struct fsl_esdhc_plat *plat; struct fsl_esdhc_plat *plat;
struct fsl_esdhc_priv *priv; struct fsl_esdhc_priv *priv;
struct mmc *mmc;
int ret; int ret;
if (!cfg) if (!cfg)
...@@ -915,6 +909,12 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg) ...@@ -915,6 +909,12 @@ int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg)
return ret; return ret;
} }
mmc = mmc_create(&plat->cfg, priv);
if (!mmc)
return -EIO;
priv->mmc = mmc;
return 0; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment