This is an automated email from Gerrit.

"zapb <d...@zapb.de>" just uploaded a new patch set to Gerrit, which you can 
find at https://review.openocd.org/c/openocd/+/9067

-- gerrit

commit df8b431d6f6b0d1e3270187ee6bf422e04d8f115
Author: Marc Schink <d...@zapb.de>
Date:   Sat Aug 2 11:13:50 2025 +0200

    adapter/cmsis-dap: Fix 'usb interface' command
    
    Simplify syntax error handling and make the documentation and code
    consistent.
    
    Change-Id: Ib8ee5adff2071964fc6d8e153f3eb82dd20054f3
    Signed-off-by: Marc Schink <d...@zapb.de>

diff --git a/doc/openocd.texi b/doc/openocd.texi
index 90ed9d3b60..2d57ff5ec9 100644
--- a/doc/openocd.texi
+++ b/doc/openocd.texi
@@ -2579,7 +2579,7 @@ This is the default if @command{cmsis-dap backend} is not 
specified.
 @end itemize
 @end deffn
 
-@deffn {Config Command} {cmsis-dap usb interface} [number]
+@deffn {Config Command} {cmsis-dap usb interface} number
 Specifies the @var{number} of the USB interface to use in v2 mode (USB bulk).
 In most cases need not to be specified and interfaces are searched by
 interface string or for user class interface.
diff --git a/src/jtag/drivers/cmsis_dap_usb_bulk.c 
b/src/jtag/drivers/cmsis_dap_usb_bulk.c
index 0dd6b2bbce..d34d4e31c1 100644
--- a/src/jtag/drivers/cmsis_dap_usb_bulk.c
+++ b/src/jtag/drivers/cmsis_dap_usb_bulk.c
@@ -659,10 +659,10 @@ static void cmsis_dap_usb_cancel_all(struct cmsis_dap 
*dap)
 
 COMMAND_HANDLER(cmsis_dap_handle_usb_interface_command)
 {
-       if (CMD_ARGC == 1)
-               COMMAND_PARSE_NUMBER(int, CMD_ARGV[0], cmsis_dap_usb_interface);
-       else
-               LOG_ERROR("expected exactly one argument to 
cmsis_dap_usb_interface <interface_number>");
+       if (CMD_ARGC != 1)
+               return ERROR_COMMAND_SYNTAX_ERROR;
+
+       COMMAND_PARSE_NUMBER(int, CMD_ARGV[0], cmsis_dap_usb_interface);
 
        return ERROR_OK;
 }
@@ -673,7 +673,7 @@ const struct command_registration 
cmsis_dap_usb_subcommand_handlers[] = {
                .handler = &cmsis_dap_handle_usb_interface_command,
                .mode = COMMAND_CONFIG,
                .help = "set the USB interface number to use (for USB bulk 
backend only)",
-               .usage = "<interface_number>",
+               .usage = "<number>",
        },
        COMMAND_REGISTRATION_DONE
 };

-- 

Reply via email to