From patchwork Sun May 23 18:47:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jind=C5=99ich_Makovi=C4=8Dka?= X-Patchwork-Id: 101760 X-Patchwork-Delegate: jikos@jikos.cz Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4NIoBOt020277 for ; Sun, 23 May 2010 18:50:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755172Ab0EWSuF (ORCPT ); Sun, 23 May 2010 14:50:05 -0400 Received: from lo.gmane.org ([80.91.229.12]:47606 "EHLO lo.gmane.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755119Ab0EWSuE (ORCPT ); Sun, 23 May 2010 14:50:04 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OGGFP-0002P9-4j for linux-input@vger.kernel.org; Sun, 23 May 2010 20:50:03 +0200 Received: from r11jd148.net.upc.cz ([94.113.7.148]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 23 May 2010 20:50:03 +0200 Received: from makovick by r11jd148.net.upc.cz with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 23 May 2010 20:50:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: linux-input@vger.kernel.org connect(): No such file or directory From: Jindrich Makovicka Subject: [PATCH] HID: check for HID_QUIRK_IGNORE during probing Date: Sun, 23 May 2010 20:47:25 +0200 Lines: 65 Message-ID: <20100523204725.6e9e8dad@holly> Mime-Version: 1.0 X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: r11jd148.net.upc.cz X-Newsreader: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 23 May 2010 18:50:11 +0000 (UTC) --- 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);