]> sigrok.org Git - libsigrok.git/blobdiff - hardware/common/ezusb.c
saleae-logic: support for other FX2 devices (bare FX2)
[libsigrok.git] / hardware / common / ezusb.c
index 3cd4f03abee4f145f7df62858e4dcff673202b60..d5365cf1bed8be00f93a41534bec0abfd56da49f 100644 (file)
@@ -96,6 +96,14 @@ int ezusb_upload_firmware(libusb_device *dev, int configuration,
                return 1;
        }
 
+       if (libusb_kernel_driver_active(hdl, 0)) {
+               err = libusb_detach_kernel_driver(hdl, 0);
+               if (err != 0) {
+                       g_warning("failed to detach kernel driver: %d", err);
+                       return 1;
+               }
+       }
+
        err = libusb_set_configuration(hdl, configuration);
        if (err != 0) {
                sr_warn("Unable to set configuration: %d", err);