
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@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");