Explorar el Código

dm: mmc: Ensure that block device is probed

Make sure that we probe the block device before using it when reading
the environment.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Simon Glass hace 8 años
padre
commit
01b73fe630
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6 1
      common/env_mmc.c

+ 6 - 1
common/env_mmc.c

@@ -121,7 +121,12 @@ static const char *init_mmc_for_env(struct mmc *mmc)
 	if (!mmc)
 		return "!No MMC card found";
 
-#ifndef CONFIG_BLK
+#ifdef CONFIG_BLK
+	struct udevice *dev;
+
+	if (blk_get_from_parent(mmc->dev, &dev))
+		return "!No block device";
+#else
 	if (mmc_init(mmc))
 		return "!MMC init failed";
 #endif