[U-Boot] [PATCH] cmd_nand: show nand scrub confirmation character

Florian Fainelli f.fainelli at gmail.com
Fri Mar 19 16:06:16 CET 2010


When issuing a nand scrub command, the entered character is not displayed
this may be confusing. This patch makes the input character being displayed
if it is a 'y' so that an user knows he is about to scrub his nand.

Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
---
diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index 075a8af..69cc0a8 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -327,8 +327,10 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 			     "are sure of what you are doing!\n"
 			     "\nReally scrub this NAND flash? <y/N>\n");
 
-			if (getc() == 'y' && getc() == '\r') {
-				opts.scrub = 1;
+			if (getc() == 'y') {
+				puts("y");
+				if (getc() == '\r')
+					opts.scrub = 1;
 			} else {
 				puts("scrub aborted\n");
 				return -1;


More information about the U-Boot mailing list