[U-Boot] [PATCH] fix flash_sect_erase() to display correct message

이승현 rhee4j1 at gmail.com
Fri Nov 13 09:06:32 CET 2009


flash_sect_erase() displays message "Erased #N sectors" even when
there are some protected sectors found and command "erase" fail.

Signed-off-by: Seunghyeon Rhee <seunghyeon at lpmtec.com>
---
 common/cmd_flash.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/common/cmd_flash.c b/common/cmd_flash.c
index 3773412..b3d982f 100644
--- a/common/cmd_flash.c
+++ b/common/cmd_flash.c
@@ -451,7 +451,10 @@ int flash_sect_erase (ulong addr_first, ulong addr_last)
 				rcode = flash_erase (info, s_first[bank], s_last[bank]);
 			}
 		}
-		printf ("Erased %d sectors\n", erased);
+		if (rcode == ERR_PROTECTED)
+			printf ("Not erased - protected sector(s) found\n");
+		else
+			printf ("Erased %d sectors\n", erased);
 	} else if (rcode == 0) {
 		puts ("Error: start and/or end address"
 			" not on sector boundary\n");
-- 
1.6.2.5



-------
Seunghyeon Rhee, Ph.D. / Director
LPM Technology Inc.
T +82-70-8255-6007  F +82-2-6442-6462
M +82-10-2790-0657


More information about the U-Boot mailing list