Change return value on error.

On wrong parameters a error is signalized to the calling function.

Change-Id: I484443fdb39938e20382edc9246d5ec546a5c960
Signed-off-by: Mathias K <kesmtp@freenet.de>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/282
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
This commit is contained in:
Mathias K
2011-12-16 07:48:39 +01:00
committed by Øyvind Harboe
parent 42cb62cf3b
commit 16b6b5e7a8
50 changed files with 132 additions and 220 deletions

View File

@@ -1203,8 +1203,7 @@ COMMAND_HANDLER(at91sam7_handle_gpnvm_command)
if (CMD_ARGC != 2)
{
command_print(CMD_CTX, "at91sam7 gpnvm <bit> <set | clear>");
return ERROR_OK;
return ERROR_COMMAND_SYNTAX_ERROR;
}
bank = get_flash_bank_by_num_noprobe(0);
@@ -1295,6 +1294,7 @@ static const struct command_registration at91sam7_command_handlers[] = {
struct flash_driver at91sam7_flash = {
.name = "at91sam7",
.usage = "gpnvm <bit> <set | clear>",
.commands = at91sam7_command_handlers,
.flash_bank_command = at91sam7_flash_bank_command,
.erase = at91sam7_erase,