drivers: libusb1_common code cleanup
[openocd.git] / src / jtag / drivers / stlink_usb.c
index da1d1b56492c8d9eb0c7d518b7e5f976d3586247..a186dfdef414951aeb1b7b6b3ec6c2c2d686d8e5 100644 (file)
@@ -111,7 +111,7 @@ struct stlink_usb_version {
 /** */
 struct stlink_usb_handle_s {
        /** */
-       struct jtag_libusb_device_handle *fd;
+       struct libusb_device_handle *fd;
        /** */
        struct libusb_transfer *trans;
        /** */
@@ -451,7 +451,7 @@ struct jtag_xfer {
 };
 
 static int jtag_libusb_bulk_transfer_n(
-               jtag_libusb_device_handle * dev_handle,
+               struct libusb_device_handle *dev_handle,
                struct jtag_xfer *transfers,
                size_t n_transfers,
                int timeout)
@@ -2785,7 +2785,7 @@ static int stlink_usb_open(struct hl_interface_param_s *param, void **fd)
 
                jtag_libusb_set_configuration(h->fd, 0);
 
-               if (jtag_libusb_claim_interface(h->fd, 0) != ERROR_OK) {
+               if (libusb_claim_interface(h->fd, 0) != ERROR_OK) {
                        LOG_DEBUG("claim interface failed");
                        goto error_open;
                }
@@ -2794,7 +2794,7 @@ static int stlink_usb_open(struct hl_interface_param_s *param, void **fd)
                h->rx_ep = STLINK_RX_EP;
 
                uint16_t pid;
-               if (jtag_libusb_get_pid(jtag_libusb_get_device(h->fd), &pid) != ERROR_OK) {
+               if (jtag_libusb_get_pid(libusb_get_device(h->fd), &pid) != ERROR_OK) {
                        LOG_DEBUG("libusb_get_pid failed");
                        goto error_open;
                }
@@ -2838,13 +2838,13 @@ static int stlink_usb_open(struct hl_interface_param_s *param, void **fd)
                        LOG_ERROR("read version failed");
                        goto error_open;
                } else {
-                       err = jtag_libusb_release_interface(h->fd, 0);
+                       err = libusb_release_interface(h->fd, 0);
                        if (err != ERROR_OK) {
                                LOG_ERROR("release interface failed");
                                goto error_open;
                        }
 
-                       err = jtag_libusb_reset_device(h->fd);
+                       err = libusb_reset_device(h->fd);
                        if (err != ERROR_OK) {
                                LOG_ERROR("reset device failed");
                                goto error_open;

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)