diff --git a/deploy/hyperiond.REMOVED.git-id b/deploy/hyperiond.REMOVED.git-id index 935b1da3..f603c0d1 100644 --- a/deploy/hyperiond.REMOVED.git-id +++ b/deploy/hyperiond.REMOVED.git-id @@ -1 +1 @@ -b4ecb001b419687ffbef1bebb7c274bb31ea55f1 \ No newline at end of file +d59ae219a9dad5cd6138c23122df5e3313e473cb \ No newline at end of file diff --git a/libsrc/hyperion/device/LedDeviceLightpack.cpp b/libsrc/hyperion/device/LedDeviceLightpack.cpp index aea2d9d7..b8c8fbe2 100644 --- a/libsrc/hyperion/device/LedDeviceLightpack.cpp +++ b/libsrc/hyperion/device/LedDeviceLightpack.cpp @@ -302,12 +302,16 @@ libusb_device_handle * LedDeviceLightpack::openDevice(libusb_device *device) throw error; } - error = libusb_detach_kernel_driver(handle, LIGHTPACK_INTERFACE); - if (error != LIBUSB_SUCCESS) + // detach kernel driver if it is active + if (libusb_kernel_driver_active(handle, LIGHTPACK_INTERFACE) == 1) { - std::cerr << "unable to detach kernel driver(" << error << "): " << libusb_error_name(error) << std::endl; - libusb_close(handle); - throw error; + error = libusb_detach_kernel_driver(handle, LIGHTPACK_INTERFACE); + if (error != LIBUSB_SUCCESS) + { + std::cerr << "unable to detach kernel driver(" << error << "): " << libusb_error_name(error) << std::endl; + libusb_close(handle); + throw error; + } } error = libusb_claim_interface(handle, LIGHTPACK_INTERFACE);