dm: core: Update lists_bind_fdt() to use ofnode
[oweals/u-boot.git] / drivers / mmc / mmc.c
index 3648950cf5a3fc39cb736b01eafa1b82308ff14c..3cdf6a4f3b1370a3a3ec43e39db7a52c3f6cab96 100644 (file)
@@ -1111,7 +1111,6 @@ static int mmc_startup(struct mmc *mmc)
        struct mmc_cmd cmd;
        ALLOC_CACHE_ALIGN_BUFFER(u8, ext_csd, MMC_MAX_BLOCK_LEN);
        ALLOC_CACHE_ALIGN_BUFFER(u8, test_csd, MMC_MAX_BLOCK_LEN);
-       int timeout = 1000;
        bool has_parts = false;
        bool part_completed;
        struct blk_desc *bdesc;
@@ -1167,9 +1166,6 @@ static int mmc_startup(struct mmc *mmc)
 
        err = mmc_send_cmd(mmc, &cmd, NULL);
 
-       /* Waiting for the ready status */
-       mmc_send_status(mmc, timeout);
-
        if (err)
                return err;
 
@@ -1612,17 +1608,17 @@ static int mmc_send_if_cond(struct mmc *mmc)
        return 0;
 }
 
+#ifndef CONFIG_DM_MMC
 /* board-specific MMC power initializations. */
 __weak void board_mmc_power_init(void)
 {
 }
+#endif
 
 static int mmc_power_init(struct mmc *mmc)
 {
-       board_mmc_power_init();
-
-#if defined(CONFIG_DM_MMC) && defined(CONFIG_DM_REGULATOR) && \
-       !defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_DM_MMC)
+#if defined(CONFIG_DM_REGULATOR) && !defined(CONFIG_SPL_BUILD)
        struct udevice *vmmc_supply;
        int ret;
 
@@ -1638,6 +1634,13 @@ static int mmc_power_init(struct mmc *mmc)
                puts("Error enabling VMMC supply\n");
                return ret;
        }
+#endif
+#else /* !CONFIG_DM_MMC */
+       /*
+        * Driver model should use a regulator, as above, rather than calling
+        * out to board code.
+        */
+       board_mmc_power_init();
 #endif
        return 0;
 }