]> sigrok.org Git - libsigrok.git/commitdiff
Remove unnecessary call to libusb_get_device_descriptor().
authorBert Vermeulen <redacted>
Sat, 19 Sep 2015 15:58:22 +0000 (17:58 +0200)
committerUwe Hermann <redacted>
Sun, 20 Sep 2015 22:16:42 +0000 (00:16 +0200)
src/device.c
src/hardware/lascar-el-usb/protocol.c

index db86c61bc0d3b8cc86cdfc49904c539c5dfa9242..537c89eff2ab353c167152de2af775a4317736a0 100644 (file)
@@ -541,11 +541,10 @@ SR_API const char *sr_dev_inst_connid_get(const struct sr_dev_inst *sdi)
 {
 #ifdef HAVE_LIBUSB_1_0
        struct drv_context *drvc;
-       int r, cnt, i, a, b;
+       int cnt, i, a, b;
        char connection_id[64];
        struct sr_usb_dev_inst *usb;
        struct libusb_device **devlist;
-       struct libusb_device_descriptor des;
 #endif
 
        if (!sdi)
@@ -576,12 +575,6 @@ SR_API const char *sr_dev_inst_connid_get(const struct sr_dev_inst *sdi)
                }
 
                for (i = 0; i < cnt; i++) {
-                       if ((r = libusb_get_device_descriptor(devlist[i], &des)) < 0) {
-                               sr_err("Failed to get device descriptor: %s.",
-                                      libusb_error_name(r));
-                               continue;
-                       }
-
                        /* Find the USB device by the logical address we know. */
                        b = libusb_get_bus_number(devlist[i]);
                        a = libusb_get_device_address(devlist[i]);
index 1437773c502cfbbc30ddd9e1c8becec4f5d25981..709e36779a8b2dfa93418fdba9eabf51cbdc85bb 100644 (file)
@@ -352,9 +352,8 @@ SR_PRIV struct sr_dev_inst *lascar_scan(int bus, int address)
        struct drv_context *drvc;
        struct sr_dev_inst *sdi;
        struct libusb_device **devlist;
-       struct libusb_device_descriptor des;
        libusb_device_handle *dev_hdl;
-       int dummy, ret, i;
+       int dummy, i;
        unsigned char config[MAX_CONFIGBLOCK_SIZE];
 
        drvc = di->context;
@@ -362,11 +361,6 @@ SR_PRIV struct sr_dev_inst *lascar_scan(int bus, int address)
 
        libusb_get_device_list(drvc->sr_ctx->libusb_ctx, &devlist);
        for (i = 0; devlist[i]; i++) {
-               if ((ret = libusb_get_device_descriptor(devlist[i], &des))) {
-                       sr_err("Failed to get device descriptor: %d.", ret);
-                       continue;
-               }
-
                if (libusb_get_bus_number(devlist[i]) != bus ||
                                libusb_get_device_address(devlist[i]) != address)
                        continue;