diff options
author | Ladislav Michl <ladis@linux-mips.org> | 2017-03-06 13:54:30 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-03-11 22:30:25 -0500 |
commit | 50075153fe66d8f9a859191132e8f23f11ba57d4 (patch) | |
tree | e656af2c82c37d9dffd717128187014527dc20fa /arch/arm/mach-omap2/omap3 | |
parent | e5bda8a2d88f8f3eba308fb30d7e12f3a50ab6b5 (diff) |
arm: OMAP2+: nandecc: propagate error to command return status
Currently nandecc returns zero even if underlaying
omap_nand_switch_ecc function fails. Fix that by
propagating error returned to command return value.
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'arch/arm/mach-omap2/omap3')
-rw-r--r-- | arch/arm/mach-omap2/omap3/board.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/arch/arm/mach-omap2/omap3/board.c b/arch/arm/mach-omap2/omap3/board.c index 5f5597772b..a727226563 100644 --- a/arch/arm/mach-omap2/omap3/board.c +++ b/arch/arm/mach-omap2/omap3/board.c @@ -269,38 +269,34 @@ void abort(void) *****************************************************************************/ static int do_switch_ecc(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) { + int hw, strength = 1; + if (argc < 2 || argc > 3) goto usage; if (strncmp(argv[1], "hw", 2) == 0) { - if (argc == 2) { - omap_nand_switch_ecc(1, 1); - } else { - if (strncmp(argv[2], "hamming", 7) == 0) - omap_nand_switch_ecc(1, 1); - else if (strncmp(argv[2], "bch8", 4) == 0) - omap_nand_switch_ecc(1, 8); + hw = 1; + if (argc == 3) { + if (strncmp(argv[2], "bch8", 4) == 0) + strength = 8; else if (strncmp(argv[2], "bch16", 5) == 0) - omap_nand_switch_ecc(1, 16); - else + strength = 16; + else if (strncmp(argv[2], "hamming", 7) != 0) goto usage; } } else if (strncmp(argv[1], "sw", 2) == 0) { - if (argc == 2) { - omap_nand_switch_ecc(0, 1); - } else { - if (strncmp(argv[2], "hamming", 7) == 0) - omap_nand_switch_ecc(0, 1); - else if (strncmp(argv[2], "bch8", 4) == 0) - omap_nand_switch_ecc(0, 8); - else + hw = 0; + if (argc == 3) { + if (strncmp(argv[2], "bch8", 4) == 0) + strength = 8; + else if (strncmp(argv[2], "hamming", 7) != 0) goto usage; } } else { goto usage; } - return 0; + return -omap_nand_switch_ecc(hw, strength); usage: printf ("Usage: nandecc %s\n", cmdtp->usage); |