Commit adb6e6ac authored by Bastien Nocera's avatar Bastien Nocera Committed by Greg Kroah-Hartman

USB: Also match device drivers using the ->match vfunc

We only ever used the ID table matching before, but we should also support
open-coded match functions.

Fixes: 88b7381a ("USB: Select better matching USB drivers when available")
Signed-off-by: default avatarBastien Nocera <hadess@hadess.net>
Cc: stable <stable@vger.kernel.org>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20200818110445.509668-1-hadess@hadess.netSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d54343a8
...@@ -205,8 +205,9 @@ static int __check_usb_generic(struct device_driver *drv, void *data) ...@@ -205,8 +205,9 @@ static int __check_usb_generic(struct device_driver *drv, void *data)
udrv = to_usb_device_driver(drv); udrv = to_usb_device_driver(drv);
if (udrv == &usb_generic_driver) if (udrv == &usb_generic_driver)
return 0; return 0;
if (usb_device_match_id(udev, udrv->id_table) != NULL)
return usb_device_match_id(udev, udrv->id_table) != NULL; return 1;
return (udrv->match && udrv->match(udev));
} }
static bool usb_generic_driver_match(struct usb_device *udev) static bool usb_generic_driver_match(struct usb_device *udev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment