From: Simon Glass Date: Tue, 4 Jul 2017 13:49:22 -0600 Subject: [U-Boot] [PATCH 30/39] dm: mmc: fsl_esdhc: Drop mmc_init() call from fsl_esdhc_init() In-Reply-To: <20170704194931.88240-1-sjg@chromium.org> References: <20170704194931.88240-1-sjg@chromium.org> Message-ID: <20170704194931.88240-31-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- drivers/mmc/fsl_esdhc.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index 89254bdd0c..1ca39a5026 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -763,7 +763,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; @@ -851,12 +850,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; } @@ -879,6 +872,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) @@ -909,6 +903,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; } -- 2.13.2.725.g09c95d1e9-goog