From 16b6b5e7a86353dbc0c4823fe3d772c0faca7c1c Mon Sep 17 00:00:00 2001 From: Mathias K Date: Fri, 16 Dec 2011 07:48:39 +0100 Subject: Change return value on error. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On wrong parameters a error is signalized to the calling function. Change-Id: I484443fdb39938e20382edc9246d5ec546a5c960 Signed-off-by: Mathias K Signed-off-by: Øyvind Harboe Reviewed-on: http://openocd.zylin.com/282 Tested-by: jenkins Reviewed-by: Øyvind Harboe --- src/flash/nor/stellaris.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/flash/nor/stellaris.c') diff --git a/src/flash/nor/stellaris.c b/src/flash/nor/stellaris.c index 7351aed9..c855995f 100644 --- a/src/flash/nor/stellaris.c +++ b/src/flash/nor/stellaris.c @@ -438,8 +438,7 @@ FLASH_BANK_COMMAND_HANDLER(stellaris_flash_bank_command) if (CMD_ARGC < 6) { - LOG_WARNING("incomplete flash_bank stellaris configuration"); - return ERROR_FLASH_BANK_INVALID; + return ERROR_COMMAND_SYNTAX_ERROR; } stellaris_info = calloc(sizeof(struct stellaris_flash_bank), 1); @@ -1351,8 +1350,7 @@ COMMAND_HANDLER(stellaris_handle_mass_erase_command) if (CMD_ARGC < 1) { - command_print(CMD_CTX, "stellaris mass_erase "); - return ERROR_OK; + return ERROR_COMMAND_SYNTAX_ERROR; } struct flash_bank *bank; @@ -1439,9 +1437,9 @@ done: static const struct command_registration stellaris_exec_command_handlers[] = { { .name = "mass_erase", + .usage = "", .handler = stellaris_handle_mass_erase_command, .mode = COMMAND_EXEC, - .usage = "bank_id", .help = "erase entire device", }, { -- cgit v1.2.3-18-g5258