From: Fredrik Thulin Date: Thu, 30 Dec 2010 19:42:46 +0000 (+0100) Subject: _ykusb_open_device: Detach kernel HID driver. X-Git-Tag: v1.4.0~22^2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=919d5ad91365337f33c1abbdb30474f5373194e1;p=yubikey-personalization _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. --- 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; } }