diff options
author | Mario Limonciello <Mario_Limonciello@Dell.com> | 2009-05-15 18:30:27 -0500 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-05-16 06:37:29 -0700 |
commit | a09e97ef081483ef98c6ebb0abe8a5cca7c3f314 (patch) | |
tree | 0b8f1882b6abfacc0714db568847b1c3d28bc6ac /tools | |
parent | 75dfa4bf79851b935e95ffcc0dc615b5772ceb28 (diff) | |
download | bluez-a09e97ef081483ef98c6ebb0abe8a5cca7c3f314.tar.gz |
Fix dmesg errors about hid2hci not claiming interface before usage
These errors were caused from trying to detach the kernel driver from
the interface, which was unnecessary. A simple usb_claim_interface is
all that is necessary. It is however, important to ensure the interface
claim is successful.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/hid2hci.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/tools/hid2hci.c b/tools/hid2hci.c index bf03739b..59bd984e 100644 --- a/tools/hid2hci.c +++ b/tools/hid2hci.c @@ -222,15 +222,11 @@ static int switch_dell(struct device_info *devinfo) } handle = usb_open(devinfo->dev); - if (handle) { - usb_claim_interface(handle, 0); - usb_detach_kernel_driver_np(handle, 0); - } - - err = usb_control_msg(handle, + if (handle && usb_claim_interface(handle,0) == 0) + err = usb_control_msg(handle, USB_ENDPOINT_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, - 0x09, 0x7f | (0x03 << 8), 0, - report, sizeof(report), 10000); + USB_REQ_SET_CONFIGURATION, 0x7f | (0x03 << 8), 0, + report, sizeof(report), 5000); if (err == 0) { err = -1; |