From 23d68466f827fa2f2f9b6c5768353d2f7ceab573 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Sun, 8 Apr 2018 19:47:00 +0200 Subject: [PATCH] usbtmc: Silence some overly verbose log messages. 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 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/scpi/scpi_usbtmc_libusb.c b/src/scpi/scpi_usbtmc_libusb.c index a109703e..dc17c872 100644 --- a/src/scpi/scpi_usbtmc_libusb.c +++ b/src/scpi/scpi_usbtmc_libusb.c @@ -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++) {