mmc: fsl_esdhc: clean up DM and non-DM code
[oweals/u-boot.git] / board / freescale / mx53smd / mx53smd.c
index d04f44fb3ed7f2ec0c3936ea50a9c988f368de02..cab0e79a6b19f774b70db504fc2019e94fd8bcc6 100644 (file)
@@ -1,23 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2011 Freescale Semiconductor, Inc.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
  */
 
 #include <common.h>
 #include <asm/arch/crm_regs.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/iomux-mx53.h>
-#include <asm/errno.h>
+#include <linux/errno.h>
 #include <netdev.h>
 #include <mmc.h>
-#include <fsl_esdhc.h>
+#include <fsl_esdhc_imx.h>
 #include <asm/gpio.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -46,13 +29,15 @@ int dram_init(void)
 
        return 0;
 }
-void dram_init_banksize(void)
+int dram_init_banksize(void)
 {
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 
        gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
        gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
+
+       return 0;
 }
 
 #define UART_PAD_CTRL  (PAD_CTL_HYS | PAD_CTL_DSE_HIGH | \
@@ -92,7 +77,7 @@ static void setup_iomux_fec(void)
        imx_iomux_v3_setup_multiple_pads(fec_pads, ARRAY_SIZE(fec_pads));
 }
 
-#ifdef CONFIG_FSL_ESDHC
+#ifdef CONFIG_FSL_ESDHC_IMX
 struct fsl_esdhc_cfg esdhc_cfg[1] = {
        {MMC_SDHC1_BASE_ADDR},
 };
@@ -122,7 +107,7 @@ int board_mmc_init(bd_t *bis)
        };
 
        u32 index;
-       s32 status = 0;
+       int ret;
 
        esdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);
 
@@ -137,12 +122,14 @@ int board_mmc_init(bd_t *bis)
                        printf("Warning: you configured more ESDHC controller"
                                "(%d) as supported by the board(1)\n",
                                CONFIG_SYS_FSL_ESDHC_NUM);
-                       return status;
+                       return -EINVAL;
                }
-               status |= fsl_esdhc_initialize(bis, &esdhc_cfg[index]);
+               ret = fsl_esdhc_initialize(bis, &esdhc_cfg[index]);
+               if (ret)
+                       return ret;
        }
 
-       return status;
+       return 0;
 }
 #endif