mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Added check to only detach kernel driver in LighpackDevice when it is active in the first place
Former-commit-id: 99e68e88571510bfb07a82942ee3f975f3f86a7f
This commit is contained in:
parent
aa318d5822
commit
f5f1019f72
@ -1 +1 @@
|
||||
b4ecb001b419687ffbef1bebb7c274bb31ea55f1
|
||||
d59ae219a9dad5cd6138c23122df5e3313e473cb
|
@ -302,6 +302,9 @@ libusb_device_handle * LedDeviceLightpack::openDevice(libusb_device *device)
|
||||
throw error;
|
||||
}
|
||||
|
||||
// detach kernel driver if it is active
|
||||
if (libusb_kernel_driver_active(handle, LIGHTPACK_INTERFACE) == 1)
|
||||
{
|
||||
error = libusb_detach_kernel_driver(handle, LIGHTPACK_INTERFACE);
|
||||
if (error != LIBUSB_SUCCESS)
|
||||
{
|
||||
@ -309,6 +312,7 @@ libusb_device_handle * LedDeviceLightpack::openDevice(libusb_device *device)
|
||||
libusb_close(handle);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
error = libusb_claim_interface(handle, LIGHTPACK_INTERFACE);
|
||||
if (error != LIBUSB_SUCCESS)
|
||||
|
Loading…
Reference in New Issue
Block a user