]> git.sur5r.net Git - openocd/commitdiff
ADAPTER: Fixed transport selection mechanism to support transports other than jtag...
authorTomek CEDRO <cederom@tlen.pl>
Thu, 16 Jun 2011 06:54:58 +0000 (06:54 +0000)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Thu, 16 Jun 2011 17:49:54 +0000 (19:49 +0200)
src/jtag/adapter.c

index 94843d7d4a4661c29e80e838b7fb0d6363db59f5..a0cd5e3dabe826617e445dbfcb4840fc95d65c84 100644 (file)
@@ -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;