]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_nand.c
kbuild: use scripts/Makefile.clean
[karo-tx-uboot.git] / common / cmd_nand.c
index a66f569a426134d42524feb395dc9bb37a4ded75..04ab0f19be05d911541567e09b12279984715a2a 100644 (file)
@@ -77,18 +77,21 @@ static int nand_dump(nand_info_t *nand, ulong off, int only_oob, int repeat)
                goto free_all;
        }
        printf("Page %08lx dump:\n", off);
-       i = nand->writesize >> 4;
-       p = datbuf;
 
-       while (i--) {
-               if (!only_oob)
+       if (!only_oob) {
+               i = nand->writesize >> 4;
+               p = datbuf;
+
+               while (i--) {
                        printf("\t%02x %02x %02x %02x %02x %02x %02x %02x"
                               "  %02x %02x %02x %02x %02x %02x %02x %02x\n",
                               p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7],
                               p[8], p[9], p[10], p[11], p[12], p[13], p[14],
                               p[15]);
-               p += 16;
+                       p += 16;
+               }
        }
+
        puts("OOB:\n");
        i = nand->oobsize >> 3;
        p = oobbuf;
@@ -613,11 +616,11 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                                        opts.scrub = 1;
                                else {
                                        puts("scrub aborted\n");
-                                       return -1;
+                                       return 1;
                                }
                        } else {
                                puts("scrub aborted\n");
-                               return -1;
+                               return 1;
                        }
                }
                ret = nand_erase_opts(nand, &opts);