From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jagan Teki Date: Fri, 12 May 2017 17:18:20 +0530 Subject: [U-Boot] [PATCH 1/9] mmc: fsl_esdhc: Move non DM_MMC code in #ifndef CONFIG_DM_MMC In-Reply-To: <1494589708-15276-1-git-send-email-jagan@openedev.com> References: <1494589708-15276-1-git-send-email-jagan@openedev.com> Message-ID: <1494589708-15276-2-git-send-email-jagan@openedev.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Jagan Teki Don't build non DM_MMC code when DM_MMC defined so move them into #ifndef CONFIG_DM_MMC Cc: Jaehoon Chung Signed-off-by: Jagan Teki --- drivers/mmc/fsl_esdhc.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index f3c6358..87c96ad 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -723,20 +723,6 @@ static const struct mmc_ops esdhc_ops = { .getcd = esdhc_getcd, }; -static int fsl_esdhc_cfg_to_priv(struct fsl_esdhc_cfg *cfg, - struct fsl_esdhc_priv *priv) -{ - if (!cfg || !priv) - return -EINVAL; - - priv->esdhc_regs = (struct fsl_esdhc *)(unsigned long)(cfg->esdhc_base); - priv->bus_width = cfg->max_bus_width; - priv->sdhc_clk = cfg->sdhc_clk; - priv->wp_enable = cfg->wp_enable; - - return 0; -}; - static int fsl_esdhc_init(struct fsl_esdhc_priv *priv) { struct fsl_esdhc *regs; @@ -833,6 +819,21 @@ static int fsl_esdhc_init(struct fsl_esdhc_priv *priv) return 0; } +#ifndef CONFIG_DM_MMC +static int fsl_esdhc_cfg_to_priv(struct fsl_esdhc_cfg *cfg, + struct fsl_esdhc_priv *priv) +{ + if (!cfg || !priv) + return -EINVAL; + + priv->esdhc_regs = (struct fsl_esdhc *)(unsigned long)(cfg->esdhc_base); + priv->bus_width = cfg->max_bus_width; + priv->sdhc_clk = cfg->sdhc_clk; + priv->wp_enable = cfg->wp_enable; + + return 0; +}; + int fsl_esdhc_initialize(bd_t *bis, struct fsl_esdhc_cfg *cfg) { struct fsl_esdhc_priv *priv; @@ -871,6 +872,7 @@ int fsl_esdhc_mmc_init(bd_t *bis) cfg->sdhc_clk = gd->arch.sdhc_clk; return fsl_esdhc_initialize(bis, cfg); } +#endif #ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT void mmc_adapter_card_type_ident(void) -- 1.9.1