From 919d5ad91365337f33c1abbdb30474f5373194e1 Mon Sep 17 00:00:00 2001 From: Fredrik Thulin Date: Thu, 30 Dec 2010 20:42:46 +0100 Subject: [PATCH] _ykusb_open_device: Detach kernel HID driver. This avoids the USB error: could not claim interface 0: Device or resource busy when linking with libusb-0.1 - at least on Ubuntu 10.04. --- ykcore/ykcore_libusb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ykcore/ykcore_libusb.c b/ykcore/ykcore_libusb.c index 8d8c835..287b5ac 100644 --- a/ykcore/ykcore_libusb.c +++ b/ykcore/ykcore_libusb.c @@ -159,6 +159,8 @@ void *_ykusb_open_device(int vendor_id, int product_id) && dev->descriptor.idProduct == YUBIKEY_PID) { rc = YK_EUSBERR; h = usb_open(dev); + if (h != NULL) + usb_detach_kernel_driver_np(h, 0); goto done; } } -- 2.39.5