public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Mario Limonciello <mario_limonciello@dell.com>
To: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: [PATCH] Fix dmesg errors about hid2hci not claiming interface before usage.
Date: Fri, 15 May 2009 18:31:47 -0500	[thread overview]
Message-ID: <4A0DFB63.8060006@dell.com> (raw)


[-- 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 --]

             reply	other threads:[~2009-05-15 23:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-15 23:31 Mario Limonciello [this message]
2009-05-16 13:38 ` [PATCH] Fix dmesg errors about hid2hci not claiming interface before usage Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A0DFB63.8060006@dell.com \
    --to=mario_limonciello@dell.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox