diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index 3f9af1d..36cfe7d 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -1064,7 +1064,7 @@
 void hang(void)
 {
 	puts("### ERROR ### Please RESET the board ###\n");
-	show_boot_progress(-30);
+	show_boot_error(30);
 	for (;;)
 		;
 }
diff --git a/arch/sparc/lib/board.c b/arch/sparc/lib/board.c
index 519a4fb..fcbc666 100644
--- a/arch/sparc/lib/board.c
+++ b/arch/sparc/lib/board.c
@@ -426,7 +426,7 @@
 {
 	puts("### ERROR ### Please RESET the board ###\n");
 #ifdef CONFIG_SHOW_BOOT_PROGRESS
-	show_boot_progress(-30);
+	show_boot_error(30);
 #endif
 	for (;;) ;
 }
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index c787288..6adf06e 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -222,21 +222,21 @@
 		if (fit_image_get_type(images.fit_hdr_os,
 					images.fit_noffset_os, &images.os.type)) {
 			puts("Can't get image type!\n");
-			show_boot_progress(-109);
+			show_boot_error(109);
 			return 1;
 		}
 
 		if (fit_image_get_comp(images.fit_hdr_os,
 					images.fit_noffset_os, &images.os.comp)) {
 			puts("Can't get image compression!\n");
-			show_boot_progress(-110);
+			show_boot_error(110);
 			return 1;
 		}
 
 		if (fit_image_get_os(images.fit_hdr_os,
 					images.fit_noffset_os, &images.os.os)) {
 			puts("Can't get image OS!\n");
-			show_boot_progress(-111);
+			show_boot_error(111);
 			return 1;
 		}
 
@@ -245,7 +245,7 @@
 		if (fit_image_get_load(images.fit_hdr_os, images.fit_noffset_os,
 					&images.os.load)) {
 			puts("Can't get image load address!\n");
-			show_boot_progress(-112);
+			show_boot_error(112);
 			return 1;
 		}
 		break;
@@ -348,7 +348,7 @@
 			puts("GUNZIP: uncompress, out-of-mem or overwrite "
 				"error - must RESET board to recover\n");
 			if (boot_progress)
-				show_boot_progress(-6);
+				show_boot_error(6);
 			return BOOTM_ERR_RESET;
 		}
 
@@ -370,7 +370,7 @@
 			printf("BUNZIP2: uncompress or overwrite error %d "
 				"- must RESET board to recover\n", i);
 			if (boot_progress)
-				show_boot_progress(-6);
+				show_boot_error(6);
 			return BOOTM_ERR_RESET;
 		}
 
@@ -389,7 +389,7 @@
 		if (ret != SZ_OK) {
 			printf("LZMA: uncompress or overwrite error %d "
 				"- must RESET board to recover\n", ret);
-			show_boot_progress(-6);
+			show_boot_error(6);
 			return BOOTM_ERR_RESET;
 		}
 		*load_end = load + unc_len;
@@ -407,7 +407,7 @@
 			printf("LZO: uncompress or overwrite error %d "
 			      "- must RESET board to recover\n", ret);
 			if (boot_progress)
-				show_boot_progress(-6);
+				show_boot_error(6);
 			return BOOTM_ERR_RESET;
 		}
 
@@ -649,14 +649,14 @@
 			} else {
 				puts("ERROR: new format image overwritten - "
 					"must RESET the board to recover\n");
-				show_boot_progress(-113);
+				show_boot_error(113);
 				do_reset(cmdtp, flag, argc, argv);
 			}
 		}
 		if (ret == BOOTM_ERR_UNIMPLEMENTED) {
 			if (iflag)
 				enable_interrupts();
-			show_boot_progress(-7);
+			show_boot_error(7);
 			return 1;
 		}
 	}
@@ -685,7 +685,7 @@
 			enable_interrupts();
 		printf("ERROR: booting os '%s' (%d) is not supported\n",
 			genimg_get_os_name(images.os.os), images.os.os);
-		show_boot_progress(-8);
+		show_boot_error(8);
 		return 1;
 	}
 
@@ -693,7 +693,7 @@
 
 	boot_fn(0, argc, argv, &images);
 
-	show_boot_progress(-9);
+	show_boot_error(9);
 #ifdef DEBUG
 	puts("\n## Control returned to monitor - resetting...\n");
 #endif
@@ -735,14 +735,14 @@
 
 	if (!image_check_magic(hdr)) {
 		puts("Bad Magic Number\n");
-		show_boot_progress(-1);
+		show_boot_error(1);
 		return NULL;
 	}
 	show_boot_progress(2);
 
 	if (!image_check_hcrc(hdr)) {
 		puts("Bad Header Checksum\n");
-		show_boot_progress(-2);
+		show_boot_error(2);
 		return NULL;
 	}
 
@@ -753,7 +753,7 @@
 		puts("   Verifying Checksum ... ");
 		if (!image_check_dcrc(hdr)) {
 			printf("Bad Data CRC\n");
-			show_boot_progress(-3);
+			show_boot_error(3);
 			return NULL;
 		}
 		puts("OK\n");
@@ -762,7 +762,7 @@
 
 	if (!image_check_target_arch(hdr)) {
 		printf("Unsupported Architecture 0x%x\n", image_get_arch(hdr));
-		show_boot_progress(-4);
+		show_boot_error(4);
 		return NULL;
 	}
 	return hdr;
@@ -790,7 +790,7 @@
 		puts("   Verifying Hash Integrity ... ");
 		if (!fit_image_check_hashes(fit, os_noffset)) {
 			puts("Bad Data Hash\n");
-			show_boot_progress(-104);
+			show_boot_error(104);
 			return 0;
 		}
 		puts("OK\n");
@@ -799,7 +799,7 @@
 
 	if (!fit_image_check_target_arch(fit, os_noffset)) {
 		puts("Unsupported Architecture\n");
-		show_boot_progress(-105);
+		show_boot_error(105);
 		return 0;
 	}
 
@@ -807,7 +807,7 @@
 	if (!fit_image_check_type(fit, os_noffset, IH_TYPE_KERNEL) &&
 	    !fit_image_check_type(fit, os_noffset, IH_TYPE_KERNEL_NOLOAD)) {
 		puts("Not a kernel image\n");
-		show_boot_progress(-106);
+		show_boot_error(106);
 		return 0;
 	}
 
@@ -897,7 +897,7 @@
 		default:
 			printf("Wrong Image Type for %s command\n",
 				cmdtp->name);
-			show_boot_progress(-5);
+			show_boot_error(5);
 			return NULL;
 		}
 
@@ -922,7 +922,7 @@
 
 		if (!fit_check_format(fit_hdr)) {
 			puts("Bad FIT kernel image format!\n");
-			show_boot_progress(-100);
+			show_boot_error(100);
 			return NULL;
 		}
 		show_boot_progress(100);
@@ -938,7 +938,7 @@
 			cfg_noffset = fit_conf_get_node(fit_hdr,
 							fit_uname_config);
 			if (cfg_noffset < 0) {
-				show_boot_progress(-101);
+				show_boot_error(101);
 				return NULL;
 			}
 			/* save configuration uname provided in the first
@@ -962,7 +962,7 @@
 							fit_uname_kernel);
 		}
 		if (os_noffset < 0) {
-			show_boot_progress(-103);
+			show_boot_error(103);
 			return NULL;
 		}
 
@@ -975,7 +975,7 @@
 		/* get kernel image data address and length */
 		if (fit_image_get_data(fit_hdr, os_noffset, &data, &len)) {
 			puts("Could not find kernel subimage data!\n");
-			show_boot_progress(-107);
+			show_boot_error(107);
 			return NULL;
 		}
 		show_boot_progress(108);
@@ -989,7 +989,7 @@
 #endif
 	default:
 		printf("Wrong Image Format for %s command\n", cmdtp->name);
-		show_boot_progress(-108);
+		show_boot_error(108);
 		return NULL;
 	}
 
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 @@
 		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 @@
 
 	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 @@
 	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 @@
 		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 @@
 	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 @@
 
 		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 @@
 		break;
 #endif
 	default:
-		show_boot_progress(-49);
+		show_boot_error(49);
 		puts("** Unknown image type\n");
 		return 1;
 	}
@@ -459,7 +459,7 @@
 	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 @@
 	/* 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;
 		}
diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index 035a6f6..173e551 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -788,7 +788,7 @@
 	if (s != NULL &&
 	    (strcmp(s, ".jffs2") && strcmp(s, ".e") && strcmp(s, ".i"))) {
 		printf("Unknown nand load suffix '%s'\n", s);
-		show_boot_progress(-53);
+		show_boot_error(53);
 		return 1;
 	}
 
@@ -798,7 +798,7 @@
 	r = nand_read_skip_bad(nand, offset, &cnt, (u_char *) addr);
 	if (r) {
 		puts("** Read error\n");
-		show_boot_progress (-56);
+		show_boot_error(56);
 		return 1;
 	}
 	show_boot_progress (56);
@@ -821,7 +821,7 @@
 		break;
 #endif
 	default:
-		show_boot_progress (-57);
+		show_boot_error(57);
 		puts ("** Unknown image type\n");
 		return 1;
 	}
@@ -830,7 +830,7 @@
 	r = nand_read_skip_bad(nand, offset, &cnt, (u_char *) addr);
 	if (r) {
 		puts("** Read error\n");
-		show_boot_progress (-58);
+		show_boot_error(58);
 		return 1;
 	}
 	show_boot_progress (58);
@@ -839,7 +839,7 @@
 	/* 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 (-150);
+			show_boot_error(150);
 			puts ("** Bad FIT image format\n");
 			return 1;
 		}
@@ -908,14 +908,14 @@
 #if defined(CONFIG_CMD_MTDPARTS)
 usage:
 #endif
-		show_boot_progress(-53);
+		show_boot_error(53);
 		return CMD_RET_USAGE;
 	}
 
 	show_boot_progress(53);
 	if (!boot_device) {
 		puts("\n** No boot device **\n");
-		show_boot_progress(-54);
+		show_boot_error(54);
 		return 1;
 	}
 	show_boot_progress(54);
@@ -924,7 +924,7 @@
 
 	if (idx < 0 || idx >= CONFIG_SYS_MAX_NAND_DEVICE || !nand_info[idx].name) {
 		printf("\n** Device %d not available\n", idx);
-		show_boot_progress(-55);
+		show_boot_error(55);
 		return 1;
 	}
 	show_boot_progress(55);
diff --git a/common/cmd_net.c b/common/cmd_net.c
index 3dd6810..c9f2a08 100644
--- a/common/cmd_net.c
+++ b/common/cmd_net.c
@@ -230,23 +230,23 @@
 		break;
 #endif
 	default:
-		show_boot_progress (-80);
+		show_boot_error(80);
 		return CMD_RET_USAGE;
 	}
 
-	show_boot_progress (80);
+	show_boot_progress(80);
 	if ((size = NetLoop(proto)) < 0) {
-		show_boot_progress (-81);
+		show_boot_error(81);
 		return 1;
 	}
 
-	show_boot_progress (81);
+	show_boot_progress(81);
 	/* NetLoop ok, update environment */
 	netboot_update_env();
 
 	/* done if no file was loaded (no errors though) */
 	if (size == 0) {
-		show_boot_progress (-82);
+		show_boot_error(82);
 		return 0;
 	}
 
@@ -257,9 +257,9 @@
 	rcode = bootm_maybe_autostart(cmdtp, argv[0]);
 
 	if (rcode < 0)
-		show_boot_progress (-83);
+		show_boot_error(83);
 	else
-		show_boot_progress (84);
+		show_boot_progress(84);
 	return rcode;
 }
 
diff --git a/common/env_common.c b/common/env_common.c
index 71811c4..49b55f1 100644
--- a/common/env_common.c
+++ b/common/env_common.c
@@ -228,7 +228,7 @@
 #if defined(CONFIG_ENV_IS_NOWHERE)	/* Environment not changable */
 		set_default_env(NULL);
 #else
-		show_boot_progress(-60);
+		show_boot_error(60);
 		set_default_env("!bad CRC");
 #endif
 	} else {
diff --git a/common/image.c b/common/image.c
index 95c7a15..8df03f5 100644
--- a/common/image.c
+++ b/common/image.c
@@ -373,13 +373,13 @@
 
 	if (!image_check_magic(rd_hdr)) {
 		puts("Bad Magic Number\n");
-		show_boot_progress(-10);
+		show_boot_error(10);
 		return NULL;
 	}
 
 	if (!image_check_hcrc(rd_hdr)) {
 		puts("Bad Header Checksum\n");
-		show_boot_progress(-11);
+		show_boot_error(11);
 		return NULL;
 	}
 
@@ -390,7 +390,7 @@
 		puts("   Verifying Checksum ... ");
 		if (!image_check_dcrc(rd_hdr)) {
 			puts("Bad Data CRC\n");
-			show_boot_progress(-12);
+			show_boot_error(12);
 			return NULL;
 		}
 		puts("OK\n");
@@ -403,7 +403,7 @@
 	    !image_check_type(rd_hdr, IH_TYPE_RAMDISK)) {
 		printf("No Linux %s Ramdisk Image\n",
 				genimg_get_arch_name(arch));
-		show_boot_progress(-13);
+		show_boot_error(13);
 		return NULL;
 	}
 
@@ -915,7 +915,7 @@
 			show_boot_progress(120);
 			if (!fit_check_format(fit_hdr)) {
 				puts("Bad FIT ramdisk image format!\n");
-				show_boot_progress(-120);
+				show_boot_error(120);
 				return 1;
 			}
 			show_boot_progress(121);
@@ -932,7 +932,7 @@
 				if (cfg_noffset < 0) {
 					puts("Could not find configuration "
 						"node\n");
-					show_boot_progress(-122);
+					show_boot_error(122);
 					return 1;
 				}
 				fit_uname_config = fdt_get_name(fit_hdr,
@@ -952,7 +952,7 @@
 			}
 			if (rd_noffset < 0) {
 				puts("Could not find subimage node\n");
-				show_boot_progress(-124);
+				show_boot_error(124);
 				return 1;
 			}
 
@@ -968,7 +968,7 @@
 			if (fit_image_get_data(fit_hdr, rd_noffset, &data,
 						&size)) {
 				puts("Could not find ramdisk subimage data!\n");
-				show_boot_progress(-127);
+				show_boot_error(127);
 				return 1;
 			}
 			show_boot_progress(128);
@@ -979,7 +979,7 @@
 			if (fit_image_get_load(fit_hdr, rd_noffset, &rd_load)) {
 				puts("Can't get ramdisk subimage load "
 					"address!\n");
-				show_boot_progress(-129);
+				show_boot_error(129);
 				return 1;
 			}
 			show_boot_progress(129);
@@ -3176,7 +3176,7 @@
 		puts("   Verifying Hash Integrity ... ");
 		if (!fit_image_check_hashes(fit, rd_noffset)) {
 			puts("Bad Data Hash\n");
-			show_boot_progress(-125);
+			show_boot_error(125);
 			return 0;
 		}
 		puts("OK\n");
@@ -3188,7 +3188,7 @@
 	    !fit_image_check_type(fit, rd_noffset, IH_TYPE_RAMDISK)) {
 		printf("No Linux %s Ramdisk Image\n",
 				genimg_get_arch_name(arch));
-		show_boot_progress(-126);
+		show_boot_error(126);
 		return 0;
 	}
 
diff --git a/include/bootstage.h b/include/bootstage.h
index ddfb07a..63a6435 100644
--- a/include/bootstage.h
+++ b/include/bootstage.h
@@ -54,5 +54,9 @@
  *		has occurred.
  */
 void show_boot_progress(int val);
+static inline void show_boot_error(int val)
+{
+	show_boot_progress(-val);
+}
 
 #endif
diff --git a/net/eth.c b/net/eth.c
index aed4dd6..5cefe4c 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -280,7 +280,7 @@
 
 	if (!eth_devices) {
 		puts ("No ethernet found.\n");
-		show_boot_progress (-64);
+		show_boot_error(64);
 	} else {
 		struct eth_device *dev = eth_devices;
 		char *ethprime = getenv ("ethprime");
diff --git a/post/post.c b/post/post.c
index 8705b12..f3830be 100644
--- a/post/post.c
+++ b/post/post.c
@@ -158,7 +158,7 @@
 				post_log("PASSED\n");
 			else {
 				post_log("FAILED\n");
-				show_boot_progress(-31);
+				show_boot_error(31);
 			}
 		}
 	}
@@ -295,7 +295,7 @@
 		} else {
 			if ((*test->test)(flags) != 0) {
 				post_log("FAILED\n");
-				show_boot_progress(-32);
+				show_boot_error(32);
 				show_post_progress(i, POST_AFTER, POST_FAILED);
 				if (test_flags & POST_CRITICAL)
 					gd->flags |= GD_FLG_POSTFAIL;
