]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/sysclk-lwla/api.c
Fix a few "value never read" scan-build warnings.
[libsigrok.git] / src / hardware / sysclk-lwla / api.c
index cee779eb4820861e6cf5a68de2cbfc810ddd21d4..154d4f9000ee6247fb583f78eee49b93e0febbb5 100644 (file)
@@ -203,6 +203,18 @@ static int dev_open(struct sr_dev_inst *sdi)
        if (ret != SR_OK)
                return ret;
 
+       /* Set the configuration twice to trigger a lightweight reset.
+        */
+       ret = libusb_set_configuration(usb->devhdl, USB_CONFIG);
+       if (ret == 0)
+               ret = libusb_set_configuration(usb->devhdl, USB_CONFIG);
+       if (ret != 0) {
+               sr_err("Failed to set USB configuration: %s.",
+                       libusb_error_name(ret));
+               sr_usb_close(usb);
+               return SR_ERR;
+       }
+
        ret = libusb_claim_interface(usb->devhdl, USB_INTERFACE);
        if (ret < 0) {
                sr_err("Failed to claim interface: %s.",