projects
/
oweals
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9f103b9
)
dm: mmc: Ensure that block device is probed
author
Simon Glass
<sjg@chromium.org>
Sat, 27 May 2017 17:37:18 +0000
(11:37 -0600)
committer
Jaehoon Chung
<jh80.chung@samsung.com>
Fri, 9 Jun 2017 11:25:16 +0000
(20:25 +0900)
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>
common/env_mmc.c
patch
|
blob
|
history
diff --git
a/common/env_mmc.c
b/common/env_mmc.c
index 404de85062360e3750e9fca91375f825fa070174..88b043ec35b1bd644dd5ae85aa42ab88ba30f090 100644
(file)
--- 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