diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/cmd_bootm.c | 9 | ||||
-rw-r--r-- | common/cmd_nand.c | 9 |
2 files changed, 8 insertions, 10 deletions
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 02a5013..a36e019 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -669,6 +669,13 @@ static int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, if (!ret && (states & BOOTM_STATE_OS_PREP)) ret = boot_fn(BOOTM_STATE_OS_PREP, argc, argv, images); + /* Check for unsupported subcommand. */ + if (ret) { + puts("subcommand not supported\n"); + return ret; + } + + #ifdef CONFIG_TRACE /* Pretend to run the OS, then run a user command */ if (!ret && (states & BOOTM_STATE_OS_FAKE_GO)) { @@ -699,8 +706,6 @@ err: bootstage_error(BOOTSTAGE_ID_DECOMP_UNIMPL); else if (ret == BOOTM_ERR_RESET) do_reset(cmdtp, flag, argc, argv); - else - puts("subcommand not supported\n"); return ret; } diff --git a/common/cmd_nand.c b/common/cmd_nand.c index 8b1e01a..886212a 100644 --- a/common/cmd_nand.c +++ b/common/cmd_nand.c @@ -426,7 +426,7 @@ static int raw_access(nand_info_t *nand, ulong addr, loff_t off, ulong count, } /* Adjust a chip/partition size down for bad blocks so we don't - * read/write/erase past the end of a chip/partition by accident. + * read/write past the end of a chip/partition by accident. */ static void adjust_size_for_badblocks(loff_t *size, loff_t offset, int dev) { @@ -546,7 +546,6 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) int scrub = !strncmp(cmd, "scrub", 5); int spread = 0; int args = 2; - int adjust_size = 0; const char *scrub_warn = "Warning: " "scrub option will erase all factory set bad blocks!\n" @@ -563,10 +562,8 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) spread = 1; } else if (!strcmp(&cmd[5], ".part")) { args = 1; - adjust_size = 1; } else if (!strcmp(&cmd[5], ".chip")) { args = 0; - adjust_size = 1; } else { goto usage; } @@ -586,10 +583,6 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) &maxsize) != 0) return 1; - /* size is unspecified */ - if (adjust_size && !scrub) - adjust_size_for_badblocks(&size, off, dev); - nand = &nand_info[dev]; memset(&opts, 0, sizeof(opts)); |