diff options
author | Guillaume GARDET <guillaume.gardet@free.fr> | 2014-11-25 15:34:16 +0100 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2014-11-26 11:21:16 -0500 |
commit | d3e488eaf48c49980adb8509a76f8577b1cf2599 (patch) | |
tree | d4746281d7138e2b3771c3795b29641b42c0648a /common | |
parent | 878cd63e02f63f245182a101807186b44e20f116 (diff) | |
download | u-boot-imx-d3e488eaf48c49980adb8509a76f8577b1cf2599.zip u-boot-imx-d3e488eaf48c49980adb8509a76f8577b1cf2599.tar.gz u-boot-imx-d3e488eaf48c49980adb8509a76f8577b1cf2599.tar.bz2 |
spl: Fix SPL EXT support
Commit 9f12cd0e062614e19734b2ab37842d387457c5e5 has broken SPL EXT support.
This patch update error code check to get SPL EXT support working again.
Tested on a Pandaboard (rev. A3).
Reviewed-by: Suriyan Ramasami <suriyan.r@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Tom Rini <trini@ti.com>
Diffstat (limited to 'common')
-rw-r--r-- | common/spl/spl_ext.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c index 5ff9bc5..9d37fd3 100644 --- a/common/spl/spl_ext.c +++ b/common/spl/spl_ext.c @@ -43,7 +43,7 @@ int spl_load_image_ext(block_dev_desc_t *block_dev, goto end; } err = ext4fs_read((char *)header, sizeof(struct image_header), &actlen); - if (err <= 0) { + if (err < 0) { puts("spl: ext4fs_read failed\n"); goto end; } @@ -54,12 +54,12 @@ int spl_load_image_ext(block_dev_desc_t *block_dev, end: #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT - if (err <= 0) + if (err < 0) printf("%s: error reading image %s, err - %d\n", __func__, filename, err); #endif - return err <= 0; + return err < 0; } #ifdef CONFIG_SPL_OS_BOOT @@ -95,7 +95,7 @@ int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition) goto defaults; } err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen, &actlen); - if (err <= 0) { + if (err < 0) { printf("spl: error reading image %s, err - %d, falling back to default\n", file, err); goto defaults; @@ -124,7 +124,7 @@ defaults: puts("spl: ext4fs_open failed\n"); err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen, &actlen); - if (err <= 0) { + if (err < 0) { #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT printf("%s: error reading image %s, err - %d\n", __func__, CONFIG_SPL_FS_LOAD_ARGS_NAME, err); |