From: Uwe Hermann Date: Wed, 9 Mar 2016 21:41:58 +0000 (+0100) Subject: hantek-6xxx: libusb_get_device_descriptor() cannot fail. X-Git-Tag: libsigrok-0.5.0~553 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=c940b7a32f0bad7fe50e8b3d6772f208beb71faa;p=libsigrok.git hantek-6xxx: libusb_get_device_descriptor() cannot fail. --- diff --git a/src/hardware/hantek-6xxx/api.c b/src/hardware/hantek-6xxx/api.c index caa3d0f6..b1228645 100644 --- a/src/hardware/hantek-6xxx/api.c +++ b/src/hardware/hantek-6xxx/api.c @@ -206,11 +206,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) 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)); diff --git a/src/hardware/hantek-6xxx/protocol.c b/src/hardware/hantek-6xxx/protocol.c index 37380490..4c2b8cda 100644 --- a/src/hardware/hantek-6xxx/protocol.c +++ b/src/hardware/hantek-6xxx/protocol.c @@ -39,11 +39,7 @@ SR_PRIV int hantek_6xxx_open(struct sr_dev_inst *sdi) 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)