Re: [PATCH 1/3] USB: core: Add routines for endpoint checks in old drivers

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

 





On 12.04.23 17:08, Alan Stern wrote:
On Wed, Apr 12, 2023 at 01:54:12PM +0200, Oliver Neukum wrote:

these will do the job. Yet this strikes me as unelegant. That is
if you define a data structure to match against, why not
add a pointer to it to struct usb_device_id and use that?

Struct usb_device_id doesn't seem like the right place.  Struct

Conceptually it belongs there. It describes a device, not a driver.
I would say that the name is not well chosen, but it is the right place.

usb_driver would be more appropriate.  The drivers that need this have
only one entry in their match table, which means that drivers with large

Why would that be the case? As far as I can see everything that is not
a class driver will need this or an equivalent and many of them
support multiple types of devices.

match tables (which would require a lot of extra space for the new
pointers) don't need it.

A few dozen bytes.

True, the checks could be centralized in usb_probe_interface().  What do
you think about doing it that way?

That really is the best place to put the code for checking.
And you might put into a comment that the way USB works the endpoint
number includes the direction. It is not obvious to a casual reader.

	Regards
		Oliver




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

  Powered by Linux