Skip to content
Snippets Groups Projects
Commit 01b73fe6 authored by Simon Glass's avatar Simon Glass Committed by Jaehoon Chung
Browse files

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: default avatarSimon Glass <sjg@chromium.org>
Reviewed-by: default avatarTom Rini <trini@konsulko.com>
parent 9f103b9c
No related branches found
No related tags found
No related merge requests found
...@@ -121,7 +121,12 @@ static const char *init_mmc_for_env(struct mmc *mmc) ...@@ -121,7 +121,12 @@ static const char *init_mmc_for_env(struct mmc *mmc)
if (!mmc) if (!mmc)
return "!No MMC card found"; 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)) if (mmc_init(mmc))
return "!MMC init failed"; return "!MMC init failed";
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment