This is an automated email from Gerrit.

"Antonio Borneo <borneo.anto...@gmail.com>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/8671

-- gerrit

commit c0902250ba89152b5c129131c6501a9348bc91f0
Author: Antonio Borneo <borneo.anto...@gmail.com>
Date:   Sun Dec 22 17:13:59 2024 +0100

    adapter: drop command 'adapter transports'
    
    The commit 93f2afa45f4c ("initial "transport" framework") that
    added the transport framework in 2010 was overly optimistic on the
    possibility to dynamically add, at runtime, a new adapter and to
    specify with the command 'adapter transports' the list of the
    transports supported by the new adapter.
    
    Such feature has never become part of OpenOCD, and the command
    above has never become useful nor ever been used.
    
    Drop the command 'adapter transports' and its documentation.
    Drop the helper 'transport_list_parse', now unused.
    
    Change-Id: Ie3d71c74d068fba802839b116bb9bc9af77cc83d
    Signed-off-by: Antonio Borneo <borneo.anto...@gmail.com>

diff --git a/doc/openocd.texi b/doc/openocd.texi
index 91fb787216..59a0e999dd 100644
--- a/doc/openocd.texi
+++ b/doc/openocd.texi
@@ -2412,12 +2412,6 @@ target.
 List the debug adapter drivers that have been built into
 the running copy of OpenOCD.
 @end deffn
-@deffn {Config Command} {adapter transports} transport_name+
-Specifies the transports supported by this debug adapter.
-The adapter driver builds-in similar knowledge; use this only
-when external configuration (such as jumpering) changes what
-the hardware can support.
-@end deffn
 
 @anchor{adapter gpio}
 @deffn {Config Command} {adapter gpio [ @
diff --git a/src/jtag/adapter.c b/src/jtag/adapter.c
index 04942f753b..db3d3b0fe8 100644
--- a/src/jtag/adapter.c
+++ b/src/jtag/adapter.c
@@ -392,25 +392,6 @@ COMMAND_HANDLER(handle_adapter_name)
        return ERROR_OK;
 }
 
-COMMAND_HANDLER(adapter_transports_command)
-{
-       char **transports;
-       int retval;
-
-       retval = CALL_COMMAND_HANDLER(transport_list_parse, &transports);
-       if (retval != ERROR_OK)
-               return retval;
-
-       retval = allow_transports(CMD_CTX, (const char **)transports);
-
-       if (retval != ERROR_OK) {
-               for (unsigned int i = 0; transports[i]; i++)
-                       free(transports[i]);
-               free(transports);
-       }
-       return retval;
-}
-
 COMMAND_HANDLER(handle_adapter_list_command)
 {
        if (strcmp(CMD_NAME, "list") == 0 && CMD_ARGC > 0)
@@ -1137,13 +1118,6 @@ static const struct command_registration 
adapter_command_handlers[] = {
                .usage = "",
                .chain = adapter_srst_command_handlers,
        },
-       {
-               .name = "transports",
-               .handler = adapter_transports_command,
-               .mode = COMMAND_CONFIG,
-               .help = "Declare transports the adapter supports.",
-               .usage = "transport ...",
-       },
        {
                .name = "usb",
                .mode = COMMAND_ANY,
diff --git a/src/transport/transport.c b/src/transport/transport.c
index c7293e7fda..0af1360369 100644
--- a/src/transport/transport.c
+++ b/src/transport/transport.c
@@ -166,54 +166,6 @@ struct transport *get_current_transport(void)
  * Infrastructure for Tcl interface to transports.
  */
 
-/**
- * Makes and stores a copy of a set of transports passed as
- * parameters to a command.
- *
- * @param vector where the resulting copy is stored, as an argv-style
- *     NULL-terminated vector.
- */
-COMMAND_HELPER(transport_list_parse, char ***vector)
-{
-       char **argv;
-       unsigned int n = CMD_ARGC;
-       unsigned int j = 0;
-
-       *vector = NULL;
-
-       if (n < 1)
-               return ERROR_COMMAND_SYNTAX_ERROR;
-
-       /* our return vector must be NULL terminated */
-       argv = calloc(n + 1, sizeof(char *));
-       if (!argv)
-               return ERROR_FAIL;
-
-       for (unsigned int i = 0; i < n; i++) {
-               struct transport *t;
-
-               for (t = transport_list; t; t = t->next) {
-                       if (strcmp(t->name, CMD_ARGV[i]) != 0)
-                               continue;
-                       argv[j++] = strdup(CMD_ARGV[i]);
-                       break;
-               }
-               if (!t) {
-                       LOG_ERROR("no such transport '%s'", CMD_ARGV[i]);
-                       goto fail;
-               }
-       }
-
-       *vector = argv;
-       return ERROR_OK;
-
-fail:
-       for (unsigned int i = 0; i < n; i++)
-               free(argv[i]);
-       free(argv);
-       return ERROR_FAIL;
-}
-
 COMMAND_HANDLER(handle_transport_init)
 {
        LOG_DEBUG("%s", __func__);
diff --git a/src/transport/transport.h b/src/transport/transport.h
index 00d8b07e11..2e3dcc61aa 100644
--- a/src/transport/transport.h
+++ b/src/transport/transport.h
@@ -77,8 +77,6 @@ struct transport *get_current_transport(void);
 
 int transport_register_commands(struct command_context *ctx);
 
-COMMAND_HELPER(transport_list_parse, char ***vector);
-
 int allow_transports(struct command_context *ctx, const char * const *vector);
 
 bool transport_is_jtag(void);

-- 

Reply via email to