drivers: call adapter_get_required_serial() in jtag_libusb_open()
[fw/openocd] / src / jtag / drivers / arm-jtag-ew.c
index d7afbe24df45a5b7ee73f1488a4ec42dc06e8f3a..703378940b60ac76ee8cdb33dc106048198e7ed9 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <jtag/interface.h>
 #include <jtag/commands.h>
+#include "helper/system.h"
 #include "libusb_helper.h"
 
 #define USB_VID                                                0x15ba
@@ -102,7 +103,7 @@ static int armjtagew_execute_queue(void)
        enum scan_type type;
        uint8_t *buffer;
 
-       while (cmd != NULL) {
+       while (cmd) {
                switch (cmd->type) {
                        case JTAG_RUNTEST:
                                LOG_DEBUG_IO("runtest %i cycles, end in %i",
@@ -687,7 +688,7 @@ static struct armjtagew *armjtagew_usb_open(void)
        const uint16_t pids[] = { USB_PID, 0 };
        struct libusb_device_handle *dev;
 
-       if (jtag_libusb_open(vids, pids, NULL, &dev, NULL) != ERROR_OK)
+       if (jtag_libusb_open(vids, pids, &dev, NULL) != ERROR_OK)
                return NULL;
 
        struct armjtagew *result = malloc(sizeof(struct armjtagew));