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:
@@ -121,8 +121,7 @@ NAND_DEVICE_COMMAND_HANDLER(orion_nand_device_command)
|
||||
uint8_t ale, cle;
|
||||
|
||||
if (CMD_ARGC != 3) {
|
||||
LOG_ERROR("arguments must be: <target_id> <NAND_address>");
|
||||
return ERROR_NAND_DEVICE_INVALID;
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
|
||||
hw = calloc(1, sizeof(*hw));
|
||||
@@ -156,6 +155,7 @@ static int orion_nand_init(struct nand_device *nand)
|
||||
struct nand_flash_controller orion_nand_controller =
|
||||
{
|
||||
.name = "orion",
|
||||
.usage = "<target_id> <NAND_address>",
|
||||
.command = orion_nand_command,
|
||||
.address = orion_nand_address,
|
||||
.read_data = orion_nand_read,
|
||||
|
||||
Reference in New Issue
Block a user