]> git.karo-electronics.de Git - karo-tx-uboot.git/commitdiff
karo: tx51: cleanup board_mmc_init()
authorLothar Waßmann <LW@KARO-electronics.de>
Tue, 18 Feb 2014 13:33:01 +0000 (14:33 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 18 Feb 2014 13:33:01 +0000 (14:33 +0100)
board/karo/tx51/tx51.c

index 6f22b3f0d5e62f404166965dc16e1ec8832f8959..df5773b853cbb834a289525df6615d6f2d45e0ff 100644 (file)
@@ -354,7 +354,10 @@ static struct tx51_esdhc_cfg {
        },
 };
 
-#define to_tx51_esdhc_cfg(p) container_of(p, struct tx51_esdhc_cfg, cfg)
+static inline struct tx51_esdhc_cfg *to_tx51_esdhc_cfg(struct fsl_esdhc_cfg *cfg)
+{
+       return container_of(cfg, struct tx51_esdhc_cfg, cfg);
+}
 
 int board_mmc_getcd(struct mmc *mmc)
 {
@@ -385,8 +388,6 @@ int board_mmc_init(bd_t *bis)
                                                cfg->num_pads);
                cfg->cfg.sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);
 
-               fsl_esdhc_initialize(bis, &cfg->cfg);
-
                ret = gpio_request_one(cfg->cd_gpio,
                                GPIOF_INPUT, "MMC CD");
                if (ret) {
@@ -395,6 +396,9 @@ int board_mmc_init(bd_t *bis)
                        continue;
                }
 
+               debug("%s: Initializing MMC slot %d\n", __func__, i);
+               fsl_esdhc_initialize(bis, &cfg->cfg);
+
                mmc = find_mmc_device(i);
                if (mmc == NULL)
                        continue;