]> sigrok.org Git - libsigrok.git/commitdiff
usbtmc: Silence some overly verbose log messages.
authorUwe Hermann <redacted>
Sun, 8 Apr 2018 17:47:00 +0000 (19:47 +0200)
committerUwe Hermann <redacted>
Sun, 8 Apr 2018 17:49:41 +0000 (19:49 +0200)
These trigger quite often with unrelated devices and confuse people.

  scpi_usbtmc: Failed to get configuration descriptor: LIBUSB_ERROR_NOT_FOUND, ignoring device.

src/scpi/scpi_usbtmc_libusb.c

index a109703ea0318d81d43877cc2fa1364a625b1cab..dc17c8722b44c00100ffa4a700e1769bd6787205 100644 (file)
@@ -138,8 +138,9 @@ static GSList *scpi_usbtmc_libusb_scan(struct drv_context *drvc)
 
                for (confidx = 0; confidx < des.bNumConfigurations; confidx++) {
                        if ((ret = libusb_get_config_descriptor(devlist[i], confidx, &confdes)) < 0) {
-                               sr_dbg("Failed to get configuration descriptor: %s, "
-                                      "ignoring device.", libusb_error_name(ret));
+                               if (ret != LIBUSB_ERROR_NOT_FOUND)
+                                       sr_dbg("Failed to get configuration descriptor: %s, "
+                                              "ignoring device.", libusb_error_name(ret));
                                break;
                        }
                        for (intfidx = 0; intfidx < confdes->bNumInterfaces; intfidx++) {
@@ -310,8 +311,9 @@ static int scpi_usbtmc_libusb_open(struct sr_scpi_dev_inst *scpi)
 
        for (confidx = 0; confidx < des.bNumConfigurations; confidx++) {
                if ((ret = libusb_get_config_descriptor(dev, confidx, &confdes)) < 0) {
-                       sr_dbg("Failed to get configuration descriptor: %s, "
-                              "ignoring device.", libusb_error_name(ret));
+                       if (ret != LIBUSB_ERROR_NOT_FOUND)
+                               sr_dbg("Failed to get configuration descriptor: %s, "
+                                      "ignoring device.", libusb_error_name(ret));
                        continue;
                }
                for (intfidx = 0; intfidx < confdes->bNumInterfaces; intfidx++) {