aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/usb-serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/usb-serial.c')
-rw-r--r--drivers/usb/serial/usb-serial.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 6a1b609a0d94..6e8c527e07c9 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -659,12 +659,14 @@ exit:
659static struct usb_serial_driver *search_serial_device( 659static struct usb_serial_driver *search_serial_device(
660 struct usb_interface *iface) 660 struct usb_interface *iface)
661{ 661{
662 const struct usb_device_id *id; 662 const struct usb_device_id *id = NULL;
663 struct usb_serial_driver *drv; 663 struct usb_serial_driver *drv;
664 struct usb_driver *driver = to_usb_driver(iface->dev.driver);
664 665
665 /* Check if the usb id matches a known device */ 666 /* Check if the usb id matches a known device */
666 list_for_each_entry(drv, &usb_serial_driver_list, driver_list) { 667 list_for_each_entry(drv, &usb_serial_driver_list, driver_list) {
667 id = get_iface_id(drv, iface); 668 if (drv->usb_driver == driver)
669 id = get_iface_id(drv, iface);
668 if (id) 670 if (id)
669 return drv; 671 return drv;
670 } 672 }