From: Bert Vermeulen Date: Sat, 19 Sep 2015 15:58:22 +0000 (+0200) Subject: Remove unnecessary call to libusb_get_device_descriptor(). X-Git-Tag: libsigrok-0.4.0~271 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=8de8551b8809b0818c20690c3014df6e6c4ee7fc;p=libsigrok.git Remove unnecessary call to libusb_get_device_descriptor(). --- diff --git a/src/device.c b/src/device.c index db86c61b..537c89ef 100644 --- a/src/device.c +++ b/src/device.c @@ -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]); diff --git a/src/hardware/lascar-el-usb/protocol.c b/src/hardware/lascar-el-usb/protocol.c index 1437773c..709e3677 100644 --- a/src/hardware/lascar-el-usb/protocol.c +++ b/src/hardware/lascar-el-usb/protocol.c @@ -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;