In the event that the kernel have some other driver attached to the device the attempt claim of the interface will fail.
Lost in the libusb conversion was a call to USBDEVFS_DISCONNECT to first detach any such drivers. Reintroduce this by invoking libusb_detach_kernel_driver().
As with some other libusb functions there are multiple return values denoting "success", so rely on libusb_claim_interface() to catch the actual errors.
In the event that the kernel have some other driver attached to the device the attempt claim of the interface will fail.
Lost in the libusb conversion was a call to USBDEVFS_DISCONNECT to first detach any such drivers. Reintroduce this by invoking libusb_detach_kernel_driver().
As with some other libusb functions there are multiple return values denoting "success", so rely on libusb_claim_interface() to catch the actual errors.
Reported-by: Maxim Akristiniy Suggested-by: Maxim Akristiniy