HID: check for HID_QUIRK_IGNORE during probing

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Monday, July 12, 2010 - 4:59 pm

Gitweb:     http://git.kernel.org/linus/e5a2a04c264e693eafcc78fec5add34c9e15e471
Commit:     e5a2a04c264e693eafcc78fec5add34c9e15e471
Parent:     fdd45ef44cfe84037f44ab386915b55c32a58bf7
Author:     Jindrich Makovicka <makovick@gmail.com>
AuthorDate: Thu Jun 3 12:50:42 2010 +0200
Committer:  Jiri Kosina <jkosina@suse.cz>
CommitDate: Fri Jun 4 11:19:02 2010 +0200

    HID: check for HID_QUIRK_IGNORE during probing
    
    While the hardcoded ignore list is checked in hid_add_device(), the
    user supplied ignore flags are not. Thus, the IGNORE quirk (0x0004)
    cannot be used to stop usbhid from binding devices like iBuddy, which
    has been recently removed from the ignore list due to product ID
    conflict.
    
    This patch adds the user quirk check to hid_add_device(), and makes
    hid_add_device() return -ENODEV when HID_QUIRK_IGNORE bit is set.
    
    HID_QUIRK_NO_IGNORE still takes precedence over HID_QUIRK_IGNORE.
    
    With the patch, iBuddy works properly using libusb when the following
    option is added to modprobe.d:
    
    options usbhid quirks=0x1130:0x0002:0x0004
    
    Signed-off-by: Jindrich Makovicka <makovick@gmail.com>
    Signed-off-by: Jiri Kosina <jkosina@suse.cz>
---
 drivers/hid/hid-core.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index aa0f7dc..66abecc 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1760,7 +1760,8 @@ int hid_add_device(struct hid_device *hdev)
 
 	/* we need to kill them here, otherwise they will stay allocated to
 	 * wait for coming driver */
-	if (!(hdev->quirks & HID_QUIRK_NO_IGNORE) && hid_ignore(hdev))
+	if (!(hdev->quirks & HID_QUIRK_NO_IGNORE)
+            && (hid_ignore(hdev) || (hdev->quirks & HID_QUIRK_IGNORE)))
 		return -ENODEV;
 
 	/* XXX hack, any other cleaner solution after the driver core
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
HID: check for HID_QUIRK_IGNORE during probing, Linux Kernel Mailing ..., (Mon Jul 12, 4:59 pm)