diff options
author | Simon Glass <sjg@chromium.org> | 2011-12-10 11:07:55 +0000 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2012-03-18 20:56:00 +0100 |
commit | 5ddb118da4cbd34c3c8a0231dedad56ba504699f (patch) | |
tree | 5fb2e7e107427bb6b30a5292283c88c65b42bd24 /common/cmd_ide.c | |
parent | 578ac1e9ba4c79175e69becb28e7157a84eff241 (diff) | |
download | u-boot-5ddb118da4cbd34c3c8a0231dedad56ba504699f.zip u-boot-5ddb118da4cbd34c3c8a0231dedad56ba504699f.tar.gz u-boot-5ddb118da4cbd34c3c8a0231dedad56ba504699f.tar.bz2 |
bootstage: Use show_boot_error() for -ve progress numbers
Rather than the caller negating our progress numbers to indicate an
error has occurred, which seems hacky, add a function to indicate this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'common/cmd_ide.c')
-rw-r--r-- | common/cmd_ide.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/common/cmd_ide.c b/common/cmd_ide.c index 3fb7506..c429b11 100644 --- a/common/cmd_ide.c +++ b/common/cmd_ide.c @@ -360,14 +360,14 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) boot_device = argv[2]; break; default: - show_boot_progress(-42); + show_boot_error(42); return CMD_RET_USAGE; } show_boot_progress(42); if (!boot_device) { puts("\n** No boot device **\n"); - show_boot_progress(-43); + show_boot_error(43); return 1; } show_boot_progress(43); @@ -376,7 +376,7 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) if (ide_dev_desc[dev].type == DEV_TYPE_UNKNOWN) { printf("\n** Device %d not available\n", dev); - show_boot_progress(-44); + show_boot_error(44); return 1; } show_boot_progress(44); @@ -384,14 +384,14 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) if (*ep) { if (*ep != ':') { puts("\n** Invalid boot device, use `dev[:part]' **\n"); - show_boot_progress(-45); + show_boot_error(45); return 1; } part = simple_strtoul(++ep, NULL, 16); } show_boot_progress(45); if (get_partition_info(&ide_dev_desc[dev], part, &info)) { - show_boot_progress(-46); + show_boot_error(46); return 1; } show_boot_progress(46); @@ -402,7 +402,7 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) printf("\n** Invalid partition type \"%.32s\"" " (expect \"" BOOT_PART_TYPE "\")\n", info.type); - show_boot_progress(-47); + show_boot_error(47); return 1; } show_boot_progress(47); @@ -416,7 +416,7 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) if (ide_dev_desc[dev]. block_read(dev, info.start, 1, (ulong *) addr) != 1) { printf("** Read error on %d:%d\n", dev, part); - show_boot_progress(-48); + show_boot_error(48); return 1; } show_boot_progress(48); @@ -429,7 +429,7 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) if (!image_check_hcrc(hdr)) { puts("\n** Bad Header Checksum **\n"); - show_boot_progress(-50); + show_boot_error(50); return 1; } show_boot_progress(50); @@ -447,7 +447,7 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) break; #endif default: - show_boot_progress(-49); + show_boot_error(49); puts("** Unknown image type\n"); return 1; } @@ -459,7 +459,7 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) if (ide_dev_desc[dev].block_read(dev, info.start + 1, cnt, (ulong *)(addr + info.blksz)) != cnt) { printf("** Read error on %d:%d\n", dev, part); - show_boot_progress(-51); + show_boot_error(51); return 1; } show_boot_progress(51); @@ -468,7 +468,7 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) /* This cannot be done earlier, we need complete FIT image in RAM first */ if (genimg_get_format((void *) addr) == IMAGE_FORMAT_FIT) { if (!fit_check_format(fit_hdr)) { - show_boot_progress(-140); + show_boot_error(140); puts("** Bad FIT image format\n"); return 1; } |