diff options
author | Oleksij Rempel <o.rempel@pengutronix.de> | 2018-11-16 08:58:58 +0100 |
---|---|---|
committer | Matthias Welwarsky <matthias@welwarsky.de> | 2019-02-19 08:53:47 +0000 |
commit | b04c7c2ca587feebd6506716cd84297212350608 (patch) | |
tree | 0922cd243b2f903a488772a8f8459c044c89f684 /src/jtag/drivers | |
parent | fd8a3c9516d6580ab749e4127f6dab0077a8b078 (diff) |
ftdi: use "adapter usb location" instead of ftdi_location command
Use unified "adapter usb location" instead of driver specific
command.
Change-Id: I568a76b87d09cea0f40f1580cf81f7c51402f6f1
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-on: http://openocd.zylin.com/4771
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
Diffstat (limited to 'src/jtag/drivers')
-rw-r--r-- | src/jtag/drivers/ftdi.c | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/src/jtag/drivers/ftdi.c b/src/jtag/drivers/ftdi.c index 1afedd1a..b709d28d 100644 --- a/src/jtag/drivers/ftdi.c +++ b/src/jtag/drivers/ftdi.c @@ -69,6 +69,7 @@ #endif /* project specific includes */ +#include <jtag/drivers/jtag_usb_common.h> #include <jtag/interface.h> #include <jtag/swd.h> #include <transport/transport.h> @@ -89,7 +90,6 @@ static char *ftdi_device_desc; static char *ftdi_serial; -static char *ftdi_location; static uint8_t ftdi_channel; static uint8_t ftdi_jtag_mode = JTAG_MODE; @@ -658,7 +658,7 @@ static int ftdi_initialize(void) for (int i = 0; ftdi_vid[i] || ftdi_pid[i]; i++) { mpsse_ctx = mpsse_open(&ftdi_vid[i], &ftdi_pid[i], ftdi_device_desc, - ftdi_serial, ftdi_location, ftdi_channel); + ftdi_serial, jtag_usb_get_location(), ftdi_channel); if (mpsse_ctx) break; } @@ -704,7 +704,6 @@ static int ftdi_quit(void) free(ftdi_device_desc); free(ftdi_serial); - free(ftdi_location); free(swd_cmd_queue); @@ -737,21 +736,6 @@ COMMAND_HANDLER(ftdi_handle_serial_command) return ERROR_OK; } -#ifdef HAVE_LIBUSB_GET_PORT_NUMBERS -COMMAND_HANDLER(ftdi_handle_location_command) -{ - if (CMD_ARGC == 1) { - if (ftdi_location) - free(ftdi_location); - ftdi_location = strdup(CMD_ARGV[0]); - } else { - return ERROR_COMMAND_SYNTAX_ERROR; - } - - return ERROR_OK; -} -#endif - COMMAND_HANDLER(ftdi_handle_channel_command) { if (CMD_ARGC == 1) @@ -966,15 +950,6 @@ static const struct command_registration ftdi_command_handlers[] = { .help = "set the serial number of the FTDI device", .usage = "serial_string", }, -#ifdef HAVE_LIBUSB_GET_PORT_NUMBERS - { - .name = "ftdi_location", - .handler = &ftdi_handle_location_command, - .mode = COMMAND_CONFIG, - .help = "set the USB bus location of the FTDI device", - .usage = "<bus>:port[,port]...", - }, -#endif { .name = "ftdi_channel", .handler = &ftdi_handle_channel_command, |