|
|
@ -112,14 +112,14 @@ struct libusb_device_handle *ch341configure(uint16_t vid, uint16_t pid) |
|
|
|
log_debug("Opened device [%04x:%04x]\n", USB_LOCK_VENDOR, USB_LOCK_PRODUCT); |
|
|
|
|
|
|
|
|
|
|
|
if (libusb_kernel_driver_active(devHandle, DEFAULT_INTERFACE)) { |
|
|
|
ret = libusb_detach_kernel_driver(devHandle, DEFAULT_INTERFACE); |
|
|
|
if (ret) { |
|
|
|
fprintf(stderr, "Failed to detach kernel driver: '%s'\n", strerror(-ret)); |
|
|
|
return NULL; |
|
|
|
} else |
|
|
|
log_debug("Detached kernel driver\n"); |
|
|
|
} |
|
|
|
// if (libusb_kernel_driver_active(devHandle, DEFAULT_INTERFACE)) {
|
|
|
|
// ret = libusb_detach_kernel_driver(devHandle, DEFAULT_INTERFACE);
|
|
|
|
// if (ret) {
|
|
|
|
// fprintf(stderr, "Failed to detach kernel driver: '%s'\n", strerror(-ret));
|
|
|
|
// return NULL;
|
|
|
|
// } else
|
|
|
|
// log_debug("Detached kernel driver\n");
|
|
|
|
// }
|
|
|
|
|
|
|
|
ret = libusb_get_configuration(devHandle, ¤tConfig); |
|
|
|
if (ret) { |
|
|
|