diff options
author | Simon Glass <sjg@chromium.org> | 2017-05-27 11:37:18 -0600 |
---|---|---|
committer | Jaehoon Chung <jh80.chung@samsung.com> | 2017-06-09 20:25:16 +0900 |
commit | 01b73fe63078e5bb1d375dc7d66e6f67893d3305 (patch) | |
tree | d9ca715b1a51b3262d9d08b139fa75e09c7d8703 /common/env_mmc.c | |
parent | 9f103b9cb5f8de4f196b5ef8f6ddb4749cd732ba (diff) | |
download | u-boot-01b73fe63078e5bb1d375dc7d66e6f67893d3305.tar.gz |
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>
Diffstat (limited to 'common/env_mmc.c')
-rw-r--r-- | common/env_mmc.c | 7 |
1 files changed, 6 insertions, 1 deletions
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 |