]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - common/cmd_nand.c
cmd_nand: show nand scrub confirmation character
[people/ms/u-boot.git] / common / cmd_nand.c
index 158a55fa705db7534708df308938215b564fa97a..9b0c9305306f7b6c3f55a93e185606b07067a85a 100644 (file)
@@ -9,18 +9,7 @@
  */
 
 #include <common.h>
-
-
-/*
- *
- * New NAND support
- *
- */
-#include <common.h>
 #include <linux/mtd/mtd.h>
-
-#if defined(CONFIG_CMD_NAND)
-
 #include <command.h>
 #include <watchdog.h>
 #include <malloc.h>
@@ -338,8 +327,14 @@ 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;
+                               }
                        } else {
                                puts("scrub aborted\n");
                                return -1;
@@ -686,4 +681,3 @@ U_BOOT_CMD(nboot, 4, 1, do_nandboot,
        "boot from NAND device",
        "[partition] | [[[loadAddr] dev] offset]"
 );
-#endif