From: Simon Glass Date: Sat, 27 May 2017 17:37:18 +0000 (-0600) Subject: dm: mmc: Ensure that block device is probed X-Git-Tag: v2017.07-rc2~57^2~4 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=01b73fe63078e5bb1d375dc7d66e6f67893d3305;p=oweals%2Fu-boot.git 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 Reviewed-by: Tom Rini --- diff --git a/common/env_mmc.c b/common/env_mmc.c index 404de85062..88b043ec35 100644 --- a/common/env_mmc.c +++ b/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