* [PATCH] Fix dmesg errors about hid2hci not claiming interface before usage.
@ 2009-05-15 23:31 Mario Limonciello
2009-05-16 13:38 ` Marcel Holtmann
0 siblings, 1 reply; 2+ messages in thread
From: Mario Limonciello @ 2009-05-15 23:31 UTC (permalink / raw)
To: linux-bluetooth@vger.kernel.org
[-- Attachment #1.1: Type: text/plain, Size: 420 bytes --]
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.
---
tools/hid2hci.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
--
Mario Limonciello
*Dell | Linux Engineering*
mario_limonciello@dell.com
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-Fix-dmesg-errors-about-hid2hci-not-claiming-interfac.patch --]
[-- Type: text/x-patch; name="0001-Fix-dmesg-errors-about-hid2hci-not-claiming-interfac.patch", Size: 1337 bytes --]
From b10d3ab279a4da6a22c9c1272595e8ef8fc80cd0 Mon Sep 17 00:00:00 2001
From: Mario Limonciello <Mario_Limonciello@Dell.com>
Date: Fri, 15 May 2009 18:30:27 -0500
Subject: [PATCH] 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.
---
tools/hid2hci.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/tools/hid2hci.c b/tools/hid2hci.c
index bf03739..59bd984 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;
--
1.6.0.4
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-05-16 13:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-15 23:31 [PATCH] Fix dmesg errors about hid2hci not claiming interface before usage Mario Limonciello
2009-05-16 13:38 ` Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox