[PATCH] Fix dmesg errors about hid2hci not claiming interface before usage.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx
From b10d3ab279a4da6a22c9c1272595e8ef8fc80cd0 Mon Sep 17 00:00:00 2001
From: Mario Limonciello <Mario_Limonciello@xxxxxxxx>
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: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux