X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fjtag%2Fadapter.c;h=acd434c440f58c79816f0d5c79b5de6096edff79;hb=0aefdbd446ed35bbc507c517b96e99d5e6e01e3d;hp=e16f756eb8b6a5421cc9c06d1ee6ebd9e03a2a22;hpb=1c794320615d917d0e8fb4c40d096fd22f9a824f;p=fw%2Fopenocd diff --git a/src/jtag/adapter.c b/src/jtag/adapter.c index e16f756eb..acd434c44 100644 --- a/src/jtag/adapter.c +++ b/src/jtag/adapter.c @@ -35,7 +35,7 @@ #include "minidriver.h" #include "interface.h" #include "interfaces.h" -#include "transport.h" +#include #ifdef HAVE_STRINGS_H #include @@ -47,8 +47,7 @@ */ extern struct jtag_interface *jtag_interface; - - +const char *jtag_only[] = { "jtag", NULL }; static int jim_adapter_name(Jim_Interp *interp, int argc, Jim_Obj *const *argv) @@ -93,9 +92,6 @@ static int default_srst_asserted(int *srst_asserted) return ERROR_OK; } -const char *jtag_only[] = { "jtag", NULL, }; - - COMMAND_HANDLER(interface_transport_command) { char **transports; @@ -169,9 +165,8 @@ COMMAND_HANDLER(handle_interface_command) LOG_WARNING("Adapter driver '%s' did not declare " "which transports it allows; assuming " "legacy JTAG-only", jtag_interface->name); - retval = allow_transports(CMD_CTX, - jtag_interface->transports - ? : jtag_only); + retval = allow_transports(CMD_CTX, jtag_interface->transports + ? jtag_interface->transports : jtag_only); if (ERROR_OK != retval) return retval; @@ -223,7 +218,7 @@ COMMAND_HANDLER(handle_reset_config_command) if (mask & m) { LOG_ERROR("extra reset_config %s spec (%s)", "gating", *CMD_ARGV); - return ERROR_INVALID_ARGUMENTS; + return ERROR_COMMAND_SYNTAX_ERROR; } if (m) goto next; @@ -243,7 +238,7 @@ COMMAND_HANDLER(handle_reset_config_command) if (mask & m) { LOG_ERROR("extra reset_config %s spec (%s)", "signal", *CMD_ARGV); - return ERROR_INVALID_ARGUMENTS; + return ERROR_COMMAND_SYNTAX_ERROR; } if (m) goto next; @@ -263,7 +258,7 @@ COMMAND_HANDLER(handle_reset_config_command) if (mask & m) { LOG_ERROR("extra reset_config %s spec (%s)", "combination", *CMD_ARGV); - return ERROR_INVALID_ARGUMENTS; + return ERROR_COMMAND_SYNTAX_ERROR; } if (m) goto next; @@ -279,7 +274,7 @@ COMMAND_HANDLER(handle_reset_config_command) if (mask & m) { LOG_ERROR("extra reset_config %s spec (%s)", "trst_type", *CMD_ARGV); - return ERROR_INVALID_ARGUMENTS; + return ERROR_COMMAND_SYNTAX_ERROR; } if (m) goto next; @@ -295,14 +290,14 @@ COMMAND_HANDLER(handle_reset_config_command) if (mask & m) { LOG_ERROR("extra reset_config %s spec (%s)", "srst_type", *CMD_ARGV); - return ERROR_INVALID_ARGUMENTS; + return ERROR_COMMAND_SYNTAX_ERROR; } if (m) goto next; /* caller provided nonsense; fail */ LOG_ERROR("unknown reset_config flag (%s)", *CMD_ARGV); - return ERROR_INVALID_ARGUMENTS; + return ERROR_COMMAND_SYNTAX_ERROR; next: /* Remember the bits which were specified (mask)