mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-29 08:00:26 +09:00
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>
This commit is contained in:
parent
9f103b9cb5
commit
01b73fe630
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user