]> sigrok.org Git - libsigrok.git/commitdiff
fx2lafw: Use the USB_INTERFACE #define.
authorUwe Hermann <redacted>
Thu, 9 Jul 2015 23:03:16 +0000 (01:03 +0200)
committerUwe Hermann <redacted>
Thu, 9 Jul 2015 23:22:15 +0000 (01:22 +0200)
src/hardware/fx2lafw/protocol.c

index b1c20a7159b2f3794dc29047c49b041bb325ca5c..6098f24ee30e11e8ee050ea7c659c490b2641e68 100644 (file)
@@ -245,8 +245,8 @@ SR_PRIV int fx2lafw_dev_open(struct sr_dev_inst *sdi, struct sr_dev_driver *di)
                }
 
                if (libusb_has_capability(LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER)) {
-                       if (libusb_kernel_driver_active(usb->devhdl, 0) == 1) {
-                               if ((ret = libusb_detach_kernel_driver(usb->devhdl, 0)) < 0) {
+                       if (libusb_kernel_driver_active(usb->devhdl, USB_INTERFACE) == 1) {
+                               if ((ret = libusb_detach_kernel_driver(usb->devhdl, USB_INTERFACE)) < 0) {
                                        sr_err("Failed to detach kernel driver: %s.",
                                                libusb_error_name(ret));
                                        return SR_ERR;