diff options
| author | Bastien Nocera <[email protected]> | 2020-10-22 13:55:20 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2020-10-28 12:24:58 +0000 |
| commit | 0942d59b0af46511d59dbf5bd69ec4a64d1a854c (patch) | |
| tree | 44706a2b20b1129aaf102044c32e7ee99f4bc417 /drivers/usb/core/usb.h | |
| parent | usb: host: ehci-tegra: Fix error handling in tegra_ehci_probe() (diff) | |
| download | kernel-0942d59b0af46511d59dbf5bd69ec4a64d1a854c.tar.gz kernel-0942d59b0af46511d59dbf5bd69ec4a64d1a854c.zip | |
usbcore: Check both id_table and match() when both available
From: Bastien Nocera <[email protected]>
When a USB device driver has both an id_table and a match() function, make
sure to check both to find a match, first matching the id_table, then
checking the match() function.
This makes it possible to have module autoloading done through the
id_table when devices are plugged in, before checking for further
device eligibility in the match() function.
Cc: <[email protected]> # 5.8
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Alan Stern <[email protected]>
Co-developed-by: M. Vefa Bicakci <[email protected]>
Tested-by: Bastien Nocera <[email protected]>
Signed-off-by: Bastien Nocera <[email protected]>
Signed-off-by: M. Vefa Bicakci <[email protected]>
Tested-by: Pan (Pany) YUAN <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/usb/core/usb.h')
| -rw-r--r-- | drivers/usb/core/usb.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h index c893f54a3420..82538daac8b8 100644 --- a/drivers/usb/core/usb.h +++ b/drivers/usb/core/usb.h @@ -74,6 +74,8 @@ extern int usb_match_device(struct usb_device *dev, const struct usb_device_id *id); extern const struct usb_device_id *usb_device_match_id(struct usb_device *udev, const struct usb_device_id *id); +extern bool usb_driver_applicable(struct usb_device *udev, + struct usb_device_driver *udrv); extern void usb_forced_unbind_intf(struct usb_interface *intf); extern void usb_unbind_and_rebind_marked_interfaces(struct usb_device *udev); |
