|
@@ -366,19 +366,8 @@ void usb_driver_release_interface(struct usb_driver *driver,
|
|
EXPORT_SYMBOL(usb_driver_release_interface);
|
|
EXPORT_SYMBOL(usb_driver_release_interface);
|
|
|
|
|
|
/* returns 0 if no match, 1 if match */
|
|
/* returns 0 if no match, 1 if match */
|
|
-int usb_match_one_id(struct usb_interface *interface,
|
|
|
|
- const struct usb_device_id *id)
|
|
|
|
|
|
+int usb_match_device(struct usb_device *dev, const struct usb_device_id *id)
|
|
{
|
|
{
|
|
- struct usb_host_interface *intf;
|
|
|
|
- struct usb_device *dev;
|
|
|
|
-
|
|
|
|
- /* proc_connectinfo in devio.c may call us with id == NULL. */
|
|
|
|
- if (id == NULL)
|
|
|
|
- return 0;
|
|
|
|
-
|
|
|
|
- intf = interface->cur_altsetting;
|
|
|
|
- dev = interface_to_usbdev(interface);
|
|
|
|
-
|
|
|
|
if ((id->match_flags & USB_DEVICE_ID_MATCH_VENDOR) &&
|
|
if ((id->match_flags & USB_DEVICE_ID_MATCH_VENDOR) &&
|
|
id->idVendor != le16_to_cpu(dev->descriptor.idVendor))
|
|
id->idVendor != le16_to_cpu(dev->descriptor.idVendor))
|
|
return 0;
|
|
return 0;
|
|
@@ -409,6 +398,26 @@ int usb_match_one_id(struct usb_interface *interface,
|
|
(id->bDeviceProtocol != dev->descriptor.bDeviceProtocol))
|
|
(id->bDeviceProtocol != dev->descriptor.bDeviceProtocol))
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
|
|
+ return 1;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/* returns 0 if no match, 1 if match */
|
|
|
|
+int usb_match_one_id(struct usb_interface *interface,
|
|
|
|
+ const struct usb_device_id *id)
|
|
|
|
+{
|
|
|
|
+ struct usb_host_interface *intf;
|
|
|
|
+ struct usb_device *dev;
|
|
|
|
+
|
|
|
|
+ /* proc_connectinfo in devio.c may call us with id == NULL. */
|
|
|
|
+ if (id == NULL)
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
|
|
+ intf = interface->cur_altsetting;
|
|
|
|
+ dev = interface_to_usbdev(interface);
|
|
|
|
+
|
|
|
|
+ if (!usb_match_device(dev, id))
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
/* The interface class, subclass, and protocol should never be
|
|
/* The interface class, subclass, and protocol should never be
|
|
* checked for a match if the device class is Vendor Specific,
|
|
* checked for a match if the device class is Vendor Specific,
|
|
* unless the match record specifies the Vendor ID. */
|
|
* unless the match record specifies the Vendor ID. */
|