|
From: Xiaofan C. <xia...@gm...> - 2010-10-11 03:17:11
|
On Wed, Oct 6, 2010 at 4:31 PM, Peter Stuge <pe...@st...> wrote: > Xiaofan Chen wrote: >> Okay I will take a look again. In this case, the patch is good. > > I'm hesitant about the patch. I see the point, but we would be > changing semantics of the function, which I don't really like. Just wondering if you still want to apply the patch or not. I think Uwe's patch is the next best thing since you do not want to change the API yet (to add driver name as part of the parameter in libusb_kernel_driver_active) and the Linux kernel developer does not want to change the kernel yet. http://libusb.sourceforge.net/api-1.0/group__dev.html#ga76e047ca95da2b32d0e7455da1804a49 libusb_kernel_driver_active () 0 if no kernel driver is active 1 if a kernel driver is active LIBUSB_ERROR_NO_DEVICE if the device has been disconnected another LIBUSB_ERROR code on other failure Uwe's patch add a 2 as the return value to inform the user that "usbfs" is the current bound driver. Then the user can decide to proceed with the driver detaching or not. Typically the user should decide not to do so, but he can do that if he really wants to do that. Without changing the API, the other way is to patch libusb_detach_kernel_driver so that it would fail if "usbfs" is the current driver. I think that gives user less choice. -- Xiaofan |