Since libusb 1.0.16 this is guaranteed to always succeed.
This fixes bug #658.
continue;
}
- if ((ret = libusb_get_device_descriptor( devlist[i], &des)) != 0) {
- sr_warn("Failed to get device descriptor: %s.",
- libusb_error_name(ret));
- continue;
- }
+ libusb_get_device_descriptor( devlist[i], &des);
if ((ret = libusb_open(devlist[i], &hdl)) < 0)
continue;
ret = FALSE;
while (!ret) {
/* Assume the FW has not been loaded, unless proven wrong. */
- if (libusb_get_device_descriptor(dev, &des) != 0)
- break;
+ libusb_get_device_descriptor(dev, &des);
if (libusb_open(dev, &hdl) != 0)
break;
}
for (i = 0; i < device_count; i++) {
- if ((ret = libusb_get_device_descriptor(devlist[i], &des))) {
- sr_err("Failed to get device descriptor: %s.",
- libusb_error_name(ret));
- continue;
- }
+ libusb_get_device_descriptor(devlist[i], &des);
if (des.idVendor != devc->profile->vid
|| des.idProduct != devc->profile->pid)
GSList *l, *devices, *conn_devices;
struct libusb_device_descriptor des;
libusb_device **devlist;
- int ret, i, j;
+ int i, j;
const char *conn;
char connection_id[64];
continue;
}
- if ((ret = libusb_get_device_descriptor(devlist[i], &des))) {
- sr_err("Failed to get device descriptor: %s.",
- libusb_error_name(ret));
- continue;
- }
+ libusb_get_device_descriptor(devlist[i], &des);
usb_get_port_path(devlist[i], connection_id, sizeof(connection_id));
const struct libusb_interface_descriptor *intf_dsc;
int mps;
- if (libusb_get_device_descriptor(dev, &des) != 0)
- return 0;
+ libusb_get_device_descriptor(dev, &des);
if (des.bNumConfigurations != 1)
return 0;
libusb_get_device_list(drvc->sr_ctx->libusb_ctx, &devlist);
for (i = 0; devlist[i]; i++) {
- if ((err = libusb_get_device_descriptor(devlist[i], &des))) {
- sr_err("Failed to get device descriptor: %s.",
- libusb_error_name(err));
- continue;
- }
+ libusb_get_device_descriptor(devlist[i], &des);
if (des.idVendor != devc->profile->fw_vid
|| des.idProduct != devc->profile->fw_pid)
ret = FALSE;
while (!ret) {
/* Assume the FW has not been loaded, unless proven wrong. */
- if (libusb_get_device_descriptor(dev, &des) != 0)
- break;
+ libusb_get_device_descriptor(dev, &des);
if (libusb_open(dev, &hdl) != 0)
break;
GSList *l, *devices, *conn_devices;
struct libusb_device_descriptor des;
libusb_device **devlist;
- int ret;
unsigned int i, j;
const char *conn;
char connection_id[64];
continue;
}
- if ((ret = libusb_get_device_descriptor(devlist[i], &des)) != 0) {
- sr_warn("Failed to get device descriptor: %s.",
- libusb_error_name(ret));
- continue;
- }
+ libusb_get_device_descriptor(devlist[i], &des);
usb_get_port_path(devlist[i], connection_id, sizeof(connection_id));
}
for (i = 0; i < device_count; i++) {
- if ((ret = libusb_get_device_descriptor(devlist[i], &des))) {
- sr_err("Failed to get device descriptor: %s.",
- libusb_error_name(ret));
- continue;
- }
+ libusb_get_device_descriptor(devlist[i], &des);
if (des.idVendor != LOGIC16_VID || des.idProduct != LOGIC16_PID)
continue;
continue;
}
- if ((ret = libusb_get_device_descriptor( devlist[i], &des)) != 0) {
- sr_warn("Failed to get device descriptor: %s.",
- libusb_error_name(ret));
- continue;
- }
+ libusb_get_device_descriptor(devlist[i], &des);
if ((ret = libusb_open(devlist[i], &hdl)) < 0)
continue;
struct libusb_device_descriptor des;
libusb_device **devlist;
GSList *devices;
- int ret, i;
+ int i;
char connection_id[64];
(void)options;
devices = NULL;
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)) != 0) {
- sr_warn("Failed to get device descriptor: %s",
- libusb_error_name(ret));
- continue;
- }
+ libusb_get_device_descriptor(devlist[i], &des);
if (des.idVendor != VICTOR_VID || des.idProduct != VICTOR_PID)
continue;
libusb_get_device_list(drvc->sr_ctx->libusb_ctx, &devlist); /* TODO: Errors. */
for (i = 0; devlist[i]; i++) {
- ret = libusb_get_device_descriptor(devlist[i], &des);
- if (ret != 0) {
- sr_err("Failed to get device descriptor: %s.",
- libusb_error_name(ret));
- continue;
- }
+ libusb_get_device_descriptor(devlist[i], &des);
if ((ret = libusb_open(devlist[i], &hdl)) < 0)
continue;
return NULL;
}
for (i = 0; devlist[i]; i++) {
- if ((ret = libusb_get_device_descriptor(devlist[i], &des)) < 0) {
- sr_err("Failed to get device descriptor: %s.",
- libusb_error_name(ret));
- continue;
- }
+ libusb_get_device_descriptor(devlist[i], &des);
for (confidx = 0; confidx < des.bNumConfigurations; confidx++) {
if ((ret = libusb_get_config_descriptor(devlist[i], confidx, &confdes)) < 0) {
return SR_ERR;
dev = libusb_get_device(usb->devhdl);
- if ((ret = libusb_get_device_descriptor(dev, &des)) < 0) {
- sr_err("Failed to get device descriptor: %s.",
- libusb_error_name(ret));
- return SR_ERR;
- }
+ libusb_get_device_descriptor(dev, &des);
for (confidx = 0; confidx < des.bNumConfigurations; confidx++) {
if ((ret = libusb_get_config_descriptor(dev, confidx, &confdes)) < 0) {