Re: [PATCH 3/5] USB: Implement usb_device_match_id()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux