diff --git a/doc/openocd.texi b/doc/openocd.texi index e34020155..01ca7adfb 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2578,7 +2578,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 0dd6b2bbc..d34d4e31c 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 "); + 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 = "", + .usage = "", }, COMMAND_REGISTRATION_DONE };