Commit d3e488eaf48c49980adb8509a76f8577b1cf2599
Committed by
Tom Rini
1 parent
878cd63e02
Exists in
v2017.01-smarct4x
and in
37 other branches
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>
Showing 1 changed file with 5 additions and 5 deletions Side-by-side Diff
common/spl/spl_ext.c
... | ... | @@ -43,7 +43,7 @@ |
43 | 43 | goto end; |
44 | 44 | } |
45 | 45 | err = ext4fs_read((char *)header, sizeof(struct image_header), &actlen); |
46 | - if (err <= 0) { | |
46 | + if (err < 0) { | |
47 | 47 | puts("spl: ext4fs_read failed\n"); |
48 | 48 | goto end; |
49 | 49 | } |
50 | 50 | |
... | ... | @@ -54,12 +54,12 @@ |
54 | 54 | |
55 | 55 | end: |
56 | 56 | #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT |
57 | - if (err <= 0) | |
57 | + if (err < 0) | |
58 | 58 | printf("%s: error reading image %s, err - %d\n", |
59 | 59 | __func__, filename, err); |
60 | 60 | #endif |
61 | 61 | |
62 | - return err <= 0; | |
62 | + return err < 0; | |
63 | 63 | } |
64 | 64 | |
65 | 65 | #ifdef CONFIG_SPL_OS_BOOT |
... | ... | @@ -95,7 +95,7 @@ |
95 | 95 | goto defaults; |
96 | 96 | } |
97 | 97 | err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen, &actlen); |
98 | - if (err <= 0) { | |
98 | + if (err < 0) { | |
99 | 99 | printf("spl: error reading image %s, err - %d, falling back to default\n", |
100 | 100 | file, err); |
101 | 101 | goto defaults; |
... | ... | @@ -124,7 +124,7 @@ |
124 | 124 | puts("spl: ext4fs_open failed\n"); |
125 | 125 | |
126 | 126 | err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen, &actlen); |
127 | - if (err <= 0) { | |
127 | + if (err < 0) { | |
128 | 128 | #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT |
129 | 129 | printf("%s: error reading image %s, err - %d\n", |
130 | 130 | __func__, CONFIG_SPL_FS_LOAD_ARGS_NAME, err); |