From ae7ab8b09d1c69559284ad9d9e3c17345d2496dd Mon Sep 17 00:00:00 2001 From: Øyvind Harboe Date: Wed, 28 Dec 2011 13:10:52 +0100 Subject: flash: introduce .usage field for nand and nor flash driver structure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I47e7ec8fa8c70d2addc3aa52d7c97e9e1e7bb662 Signed-off-by: Øyvind Harboe Reviewed-on: http://openocd.zylin.com/301 Tested-by: jenkins Reviewed-by: Øyvind Harboe Reviewed-by: Spencer Oliver --- src/flash/nand/tcl.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/flash/nand/tcl.c') diff --git a/src/flash/nand/tcl.c b/src/flash/nand/tcl.c index 5fba1bcc..c6ea3f3b 100644 --- a/src/flash/nand/tcl.c +++ b/src/flash/nand/tcl.c @@ -544,8 +544,7 @@ static COMMAND_HELPER(create_nand_device, const char *bank_name, if (CMD_ARGC < 2) { - LOG_ERROR("missing target"); - return ERROR_COMMAND_ARGUMENT_INVALID; + return ERROR_COMMAND_SYNTAX_ERROR; } target = get_target(CMD_ARGV[1]); if (!target) { @@ -582,9 +581,12 @@ static COMMAND_HELPER(create_nand_device, const char *bank_name, retval = CALL_COMMAND_HANDLER(controller->nand_device_command, c); if (ERROR_OK != retval) { - LOG_ERROR("'%s' driver rejected nand flash", controller->name); + assert(controller->usage != NULL); + LOG_ERROR("'%s' driver rejected nand flash. Usage: %s", + controller->name, + controller->usage); free(c); - return ERROR_OK; + return retval; } nand_device_add(c); @@ -596,8 +598,7 @@ COMMAND_HANDLER(handle_nand_device_command) { if (CMD_ARGC < 2) { - LOG_ERROR("incomplete nand device configuration"); - return ERROR_FLASH_BANK_INVALID; + return ERROR_COMMAND_SYNTAX_ERROR; } // save name and increment (for compatibility) with drivers -- cgit v1.2.3-18-g5258