[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200901151012.057602221@linuxfoundation.org>
Date: Tue, 1 Sep 2020 17:11:32 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Bastien Nocera <hadess@...ess.net>,
Alan Stern <stern@...land.harvard.edu>
Subject: [PATCH 5.8 236/255] USB: Also match device drivers using the ->match vfunc
From: Bastien Nocera <hadess@...ess.net>
commit adb6e6ac20eedcf1dce19dc75b224e63c0828ea1 upstream.
We only ever used the ID table matching before, but we should also support
open-coded match functions.
Fixes: 88b7381a939de ("USB: Select better matching USB drivers when available")
Signed-off-by: Bastien Nocera <hadess@...ess.net>
Cc: stable <stable@...r.kernel.org>
Acked-by: Alan Stern <stern@...land.harvard.edu>
Link: https://lore.kernel.org/r/20200818110445.509668-1-hadess@hadess.net
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/usb/core/generic.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/drivers/usb/core/generic.c
+++ b/drivers/usb/core/generic.c
@@ -207,8 +207,9 @@ static int __check_usb_generic(struct de
return 0;
if (!udrv->id_table)
return 0;
-
- return usb_device_match_id(udev, udrv->id_table) != NULL;
+ if (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)
Powered by blists - more mailing lists