]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/saleae-logic16/api.c
No need to check return value of libusb_get_device_descriptor().
[libsigrok.git] / src / hardware / saleae-logic16 / api.c
index af421d3c96733ec83a5b0456e9c0e879171f085d..9d5231440bf806f6d05b930d0bec23257e5f7701 100644 (file)
@@ -19,6 +19,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <config.h>
 #include <glib.h>
 #include <libusb.h>
 #include <stdlib.h>
@@ -110,8 +111,7 @@ static gboolean check_conf_profile(libusb_device *dev)
        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;
@@ -147,7 +147,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        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];
@@ -186,11 +185,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
                                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));
 
@@ -271,11 +266,7 @@ static int logic16_dev_open(struct sr_dev_inst *sdi)
        }
 
        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;