diff options
author | Øyvind Harboe <oyvind.harboe@zylin.com> | 2010-09-20 09:22:46 +0200 |
---|---|---|
committer | Øyvind Harboe <oyvind.harboe@zylin.com> | 2010-09-21 22:17:38 +0200 |
commit | 22911a3aedfa01c7a5643de9c21fbb94f6219c38 (patch) | |
tree | 1b487e740c15ec34b74558a6e5ecc60ed2f30155 /src/flash/nor | |
parent | 9aafd42853b4164ea72e6e2f89008ff84b1fac52 (diff) | |
download | openocd_libswd-22911a3aedfa01c7a5643de9c21fbb94f6219c38.tar.gz openocd_libswd-22911a3aedfa01c7a5643de9c21fbb94f6219c38.tar.bz2 openocd_libswd-22911a3aedfa01c7a5643de9c21fbb94f6219c38.tar.xz openocd_libswd-22911a3aedfa01c7a5643de9c21fbb94f6219c38.zip |
flash: fix error handling
sensible error must be reported at failure site
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Diffstat (limited to 'src/flash/nor')
-rw-r--r-- | src/flash/nor/tcl.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/flash/nor/tcl.c b/src/flash/nor/tcl.c index 3dc6cff3..8604b4b3 100644 --- a/src/flash/nor/tcl.c +++ b/src/flash/nor/tcl.c @@ -132,23 +132,14 @@ COMMAND_HANDLER(handle_flash_probe_command) { command_print(CMD_CTX, "flash '%s' found at 0x%8.8" PRIx32, p->driver->name, p->base); } - else if (retval == ERROR_FLASH_BANK_INVALID) - { - command_print(CMD_CTX, "probing failed for flash bank '#%s' at 0x%8.8" PRIx32, - CMD_ARGV[0], p->base); - } - else - { - command_print(CMD_CTX, "unknown error when probing flash bank '#%s' at 0x%8.8" PRIx32, - CMD_ARGV[0], p->base); - } } else { command_print(CMD_CTX, "flash bank '#%s' is out of bounds", CMD_ARGV[0]); + retval = ERROR_FAIL; } - return ERROR_OK; + return retval; } COMMAND_HANDLER(handle_flash_erase_check_command) |