@@ -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);