diff options
author | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-06-08 10:54:06 +0000 |
---|---|---|
committer | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-06-08 10:54:06 +0000 |
commit | 620ecedf42951888786d72be099adbf48f2c73f1 (patch) | |
tree | 9e26e4c95b51f1d05312aee47f4ee7d053668ab8 | |
parent | e468797e4105387e4b2f2dc05f4301ec2d2cce66 (diff) | |
download | openocd+libswd-620ecedf42951888786d72be099adbf48f2c73f1.tar.gz openocd+libswd-620ecedf42951888786d72be099adbf48f2c73f1.tar.bz2 openocd+libswd-620ecedf42951888786d72be099adbf48f2c73f1.tar.xz openocd+libswd-620ecedf42951888786d72be099adbf48f2c73f1.zip |
Simplify logic in handle_jtag_speed_command.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2109 b42882b7-edfa-0310-969c-e2dbd0fdcd60
-rw-r--r-- | src/jtag/jtag.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/jtag/jtag.c b/src/jtag/jtag.c index 8bc19112..f58c90e1 100644 --- a/src/jtag/jtag.c +++ b/src/jtag/jtag.c @@ -2144,8 +2144,10 @@ static int handle_jtag_ntrst_delay_command(struct command_context_s *cmd_ctx, ch static int handle_jtag_speed_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { - int retval=ERROR_OK; + int retval = ERROR_OK; + if (argc > 1) + return ERROR_COMMAND_SYNTAX_ERROR; if (argc == 1) { LOG_DEBUG("handle jtag speed"); @@ -2156,14 +2158,7 @@ static int handle_jtag_speed_command(struct command_context_s *cmd_ctx, char *cm /* this command can be called during CONFIG, * in which case jtag isn't initialized */ if (jtag) - { - retval=jtag->speed(cur_speed); - } - } else if (argc == 0) - { - } else - { - return ERROR_COMMAND_SYNTAX_ERROR; + retval = jtag->speed(cur_speed); } command_print(cmd_ctx, "jtag_speed: %d", jtag_speed); |