# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.521   -> 1.522  
#	drivers/usb/serial/usbserial.c	1.36    -> 1.37   
#	 include/linux/usb.h	1.45    -> 1.46   
#	drivers/usb/storage/scsiglue.c	1.27    -> 1.28   
#	drivers/usb/core/usb.c	1.81    -> 1.82   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/08/14	greg@kroah.com	1.522
# USB: changed usb_match_id to not need the usb_device pointer.
# --------------------------------------------
#
diff -Nru a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
--- a/drivers/usb/core/usb.c	Wed Aug 14 14:41:47 2002
+++ b/drivers/usb/core/usb.c	Wed Aug 14 14:41:47 2002
@@ -206,7 +206,7 @@
 	if (id) {
 		for (i = 0; i < interface->num_altsetting; i++) {
 		  	interface->act_altsetting = i;
-			id = usb_match_id(dev, interface, id);
+			id = usb_match_id(interface, id);
 			if (id) {
 				down(&driver->serialize);
 				private = driver->probe(dev,ifnum,id);
@@ -466,7 +466,6 @@
 
 /**
  * usb_match_id - find first usb_device_id matching device or interface
- * @dev: the device whose descriptors are considered when matching
  * @interface: the interface of interest
  * @id: array of usb_device_id structures, terminated by zero entry
  *
@@ -528,15 +527,18 @@
  * its associated class and subclass.
  */   
 const struct usb_device_id *
-usb_match_id(struct usb_device *dev, struct usb_interface *interface,
-	     const struct usb_device_id *id)
+usb_match_id(struct usb_interface *interface, const struct usb_device_id *id)
 {
-	struct usb_interface_descriptor	*intf = 0;
+	struct usb_interface_descriptor *intf;
+	struct usb_device *dev;
 
 	/* proc_connectinfo in devio.c may call us with id == NULL. */
 	if (id == NULL)
 		return NULL;
 
+	intf = &interface->altsetting [interface->act_altsetting];
+	dev = interface_to_usbdev(interface);
+
 	/* It is important to check that id->driver_info is nonzero,
 	   since an entry that is all zeroes except for a nonzero
 	   id->driver_info is the way to create an entry that
@@ -575,19 +577,17 @@
 		    (id->bDeviceProtocol != dev->descriptor.bDeviceProtocol))
 			continue;
 
-		intf = &interface->altsetting [interface->act_altsetting];
-
 		if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_CLASS) &&
 		    (id->bInterfaceClass != intf->bInterfaceClass))
 			continue;
 
 		if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_SUBCLASS) &&
 		    (id->bInterfaceSubClass != intf->bInterfaceSubClass))
-		    continue;
+			continue;
 
 		if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_PROTOCOL) &&
 		    (id->bInterfaceProtocol != intf->bInterfaceProtocol))
-		    continue;
+			continue;
 
 		return id;
 	}
diff -Nru a/drivers/usb/serial/usbserial.c b/drivers/usb/serial/usbserial.c
--- a/drivers/usb/serial/usbserial.c	Wed Aug 14 14:41:47 2002
+++ b/drivers/usb/serial/usbserial.c	Wed Aug 14 14:41:47 2002
@@ -1193,7 +1193,7 @@
 	interface = &dev->actconfig->interface[ifnum];
 	list_for_each (tmp, &usb_serial_driver_list) {
 		type = list_entry(tmp, struct usb_serial_device_type, driver_list);
-		id_pattern = usb_match_id(dev, interface, type->id_table);
+		id_pattern = usb_match_id(interface, type->id_table);
 		if (id_pattern != NULL) {
 			dbg("descriptor matches");
 			found = 1;
diff -Nru a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
--- a/drivers/usb/storage/scsiglue.c	Wed Aug 14 14:41:47 2002
+++ b/drivers/usb/storage/scsiglue.c	Wed Aug 14 14:41:47 2002
@@ -265,7 +265,7 @@
 		US_DEBUGPX("simulating disconnect/reconnect.\n");
 		down(&intf->driver->serialize);
 		intf->driver->disconnect(pusb_dev_save, intf->private_data);
-		id = usb_match_id(pusb_dev_save, intf, intf->driver->id_table);
+		id = usb_match_id(intf, intf->driver->id_table);
 		intf->driver->probe(pusb_dev_save, i, id);
 		up(&intf->driver->serialize);
 	}
diff -Nru a/include/linux/usb.h b/include/linux/usb.h
--- a/include/linux/usb.h	Wed Aug 14 14:41:47 2002
+++ b/include/linux/usb.h	Wed Aug 14 14:41:47 2002
@@ -443,8 +443,7 @@
 extern int usb_interface_claimed(struct usb_interface *iface);
 extern void usb_driver_release_interface(struct usb_driver *driver,
 			struct usb_interface *iface);
-const struct usb_device_id *usb_match_id(struct usb_device *dev,
-					 struct usb_interface *interface,
+const struct usb_device_id *usb_match_id(struct usb_interface *interface,
 					 const struct usb_device_id *id);
 
 /**
