aboutsummaryrefslogtreecommitdiff
path: root/src/pld
diff options
context:
space:
mode:
authorMathias K <kesmtp@freenet.de>2011-12-16 07:48:39 +0100
committerØyvind Harboe <oyvindharboe@gmail.com>2012-01-04 17:56:46 +0000
commit16b6b5e7a86353dbc0c4823fe3d772c0faca7c1c (patch)
tree4950e26d07d60b16b3223e085227c583418c2ef8 /src/pld
parent42cb62cf3b47b982d6444948b483f9c6ce32de05 (diff)
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>
Diffstat (limited to 'src/pld')
-rw-r--r--src/pld/pld.c6
-rw-r--r--src/pld/virtex2.c6
2 files changed, 4 insertions, 8 deletions
diff --git a/src/pld/pld.c b/src/pld/pld.c
index 90067e34..b2623613 100644
--- a/src/pld/pld.c
+++ b/src/pld/pld.c
@@ -63,8 +63,7 @@ COMMAND_HANDLER(handle_pld_device_command)
if (CMD_ARGC < 1)
{
- LOG_WARNING("incomplete 'pld device' command");
- return ERROR_OK;
+ return ERROR_COMMAND_SYNTAX_ERROR;
}
for (i = 0; pld_drivers[i]; i++)
@@ -155,8 +154,7 @@ COMMAND_HANDLER(handle_pld_load_command)
if (CMD_ARGC < 2)
{
- command_print(CMD_CTX, "usage: pld load <device#> <file>");
- return ERROR_OK;
+ return ERROR_COMMAND_SYNTAX_ERROR;
}
unsigned dev_id;
diff --git a/src/pld/virtex2.c b/src/pld/virtex2.c
index fdaeb61e..f4aed34f 100644
--- a/src/pld/virtex2.c
+++ b/src/pld/virtex2.c
@@ -179,8 +179,7 @@ COMMAND_HANDLER(virtex2_handle_read_stat_command)
if (CMD_ARGC < 1)
{
- command_print(CMD_CTX, "usage: virtex2 read_stat <num>");
- return ERROR_OK;
+ return ERROR_COMMAND_SYNTAX_ERROR;
}
unsigned dev_id;
@@ -207,8 +206,7 @@ PLD_DEVICE_COMMAND_HANDLER(virtex2_pld_device_command)
if (CMD_ARGC < 2)
{
- LOG_WARNING("incomplete pld device 'virtex2' configuration");
- return ERROR_PLD_DEVICE_INVALID;
+ return ERROR_COMMAND_SYNTAX_ERROR;
}
tap = jtag_tap_by_string(CMD_ARGV[1]);