[PATCH v3 14/32] bootm: Use the error return from boot_get_kernel()
Simon Glass
sjg at chromium.org
Sat Nov 18 22:05:02 CET 2023
Rather than looking for a zero-sized image, use the error code returned
to determine if things are OK.
Signed-off-by: Simon Glass <sjg at chromium.org>
Reviewed-by: Tom Rini <trini at konsulko.com>
---
(no changes since v2)
Changes in v2:
- Use the command table to provide the command name, instead of "bootm"
boot/bootm.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/boot/bootm.c b/boot/bootm.c
index 6ed60bf05084..a23c791a9e15 100644
--- a/boot/bootm.c
+++ b/boot/bootm.c
@@ -324,9 +324,9 @@ static int bootm_find_os(struct cmd_tbl *cmdtp, int flag, int argc,
/* get kernel image header, start address and length */
ret = boot_get_kernel(cmdtp->name, argv[0], &images,
&images.os.image_start, &images.os.image_len,
- &os_hdr);
- if (images.os.image_len == 0) {
- puts("ERROR: can't get kernel image!\n");
+ &os_hdr);
+ if (ret) {
+ printf("ERROR %dE: can't get kernel image!\n", ret);
return 1;
}
--
2.43.0.rc0.421.g78406f8d94-goog
More information about the U-Boot
mailing list