diff mbox

HID: check for HID_QUIRK_IGNORE during probing

Message ID 20100523204725.6e9e8dad@holly (mailing list archive)
State New, archived
Delegated to: Jiri Kosina
Headers show

Commit Message

Jindřich Makovička May 23, 2010, 6:47 p.m. UTC
None
diff mbox

Patch

--- hid-core.c.orig	2010-05-16 23:17:36.000000000 +0200
+++ hid-core.c	2010-05-23 20:23:28.471259245 +0200
@@ -864,8 +864,7 @@  static int usbhid_parse(struct hid_devic
 	quirks = usbhid_lookup_quirk(le16_to_cpu(dev->descriptor.idVendor),
 			le16_to_cpu(dev->descriptor.idProduct));
 
-	if (quirks & HID_QUIRK_IGNORE)
-		return -ENODEV;
+	WARN_ON(quirks & HID_QUIRK_IGNORE);
 
 	/* Many keyboards and mice don't like to be polled for reports,
 	 * so we will always set the HID_QUIRK_NOGET flag for them. */
@@ -1098,6 +1097,7 @@  static int usbhid_probe(struct usb_inter
 	struct usb_device *dev = interface_to_usbdev(intf);
 	struct usbhid_device *usbhid;
 	struct hid_device *hid;
+	u32 quirks = 0;
 	unsigned int n, has_in = 0;
 	size_t len;
 	int ret;
@@ -1114,6 +1114,12 @@  static int usbhid_probe(struct usb_inter
 		return -ENODEV;
 	}
 
+	quirks = usbhid_lookup_quirk(le16_to_cpu(dev->descriptor.idVendor),
+			le16_to_cpu(dev->descriptor.idProduct));
+
+	if (quirks & HID_QUIRK_IGNORE)
+		return -ENODEV;
+
 	hid = hid_allocate_device();
 	if (IS_ERR(hid))
 		return PTR_ERR(hid);