Skip to content

Commit

Permalink
HID: check for HID_QUIRK_IGNORE during probing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jindrich Makovicka authored and Jiri Kosina committed Jun 4, 2010
1 parent fdd45ef commit e5a2a04
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/hid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e5a2a04

Please sign in to comment.