summaryrefslogtreecommitdiff
path: root/common/spl/spl_mmc.c
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2016-04-28 22:44:54 (GMT)
committerStefano Babic <sbabic@denx.de>2016-05-17 15:52:20 (GMT)
commit7e0f22674ae871460706f9cc8653487bb51e0804 (patch)
tree604b55f32c78eee29614bfd6a99d7525f168384d /common/spl/spl_mmc.c
parent249092fa81f3dd3fee94fd05973833e30405f3c4 (diff)
downloadu-boot-fsl-qoriq-7e0f22674ae871460706f9cc8653487bb51e0804.tar.xz
SPL: Let spl_parse_image_header() return value
Allow the spl_parse_image_header() to return value. This is convenient for controlling the SPL boot flow if the loaded image is corrupted. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabio Estevam <fabio.estevam@nxp.com> Cc: Peng Fan <van.freenix@gmail.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'common/spl/spl_mmc.c')
-rw-r--r--common/spl/spl_mmc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index 8d588d1..360c754 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -23,8 +23,12 @@ static int mmc_load_legacy(struct mmc *mmc, ulong sector,
{
u32 image_size_sectors;
unsigned long count;
+ int ret;
+
+ ret = spl_parse_image_header(header);
+ if (ret)
+ return ret;
- spl_parse_image_header(header);
/* convert size to sectors - round up */
image_size_sectors = (spl_image.size + mmc->read_bl_len - 1) /
mmc->read_bl_len;