aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMario Limonciello <Mario_Limonciello@Dell.com>2009-05-18 13:07:40 -0500
committerMarcel Holtmann <marcel@holtmann.org>2009-05-18 11:15:45 -0700
commit4e90276635ef17312d56e81fe992b175622cd6b5 (patch)
tree538ecefd2d1be28705aeacb1da80992f512e1155 /tools
parente03fc08c74c07641eee008661a883451d4188b2e (diff)
downloadbluez-4e90276635ef17312d56e81fe992b175622cd6b5.tar.gz
Reinstitute usb_detach_kernel_driver_np, but in the proper place
The kernel might still be grab the usb device, so release it before claim.
Diffstat (limited to 'tools')
-rw-r--r--tools/hid2hci.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/hid2hci.c b/tools/hid2hci.c
index d5c8d32d..c5b6558c 100644
--- a/tools/hid2hci.c
+++ b/tools/hid2hci.c
@@ -223,6 +223,10 @@ static int switch_dell(struct device_info *devinfo)
handle = usb_open(devinfo->dev);
+ /* Don't need to check return, as might not be in use */
+ if (handle)
+ usb_detach_kernel_driver_np(handle, 0);
+
if (handle && usb_claim_interface(handle,0) == 0)
err = usb_control_msg(handle,
USB_ENDPOINT_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,