From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B5E1ECE58D for ; Wed, 9 Oct 2019 17:29:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4B69120679 for ; Wed, 9 Oct 2019 17:29:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732383AbfJIR34 (ORCPT ); Wed, 9 Oct 2019 13:29:56 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:51574 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1732459AbfJIR3u (ORCPT ); Wed, 9 Oct 2019 13:29:50 -0400 Received: (qmail 5516 invoked by uid 2102); 9 Oct 2019 13:29:49 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 9 Oct 2019 13:29:49 -0400 Date: Wed, 9 Oct 2019 13:29:49 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Bastien Nocera cc: linux-usb@vger.kernel.org, Greg Kroah-Hartman , Benjamin Tissoires Subject: Re: [PATCH 3/5] USB: Implement usb_device_match_id() In-Reply-To: <2bbaeba7abb332aaf9fb521602f7199ba1e77273.camel@hadess.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Wed, 9 Oct 2019, Bastien Nocera wrote: > > This would be better if you allowed matching against just the > > idVendor > > field rather than matching against both. That would make it a lot > > simpler to match all Apple devices, for instance. > > That should already be possible. The matching code is the same as for > the USB interface drivers. > > Something like: > static const struct usb_device_id apple_match[] = { > { .match_flags = USB_DEVICE_ID_MATCH_VENDOR, > .idVendor = USB_VENDOR_APPLE > }, > {} > } > > And I couldn't use it in patch 5/5, as that's a range of product IDs, > not all of them (which would be quite a lot more). You can still use it in patch 5/5. Match any device with Apple's VID; then have the probe routine return -ENODEV if the PID is outside the range you want. Alan Stern