summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/core/hcd.h3
-rw-r--r--drivers/usb/core/usb.c1
-rw-r--r--drivers/usb/storage/scsiglue.c5
-rw-r--r--include/linux/usb.h4
4 files changed, 8 insertions, 5 deletions
diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h
index a3d924e2e34c..8e8f58fb33d6 100644
--- a/drivers/usb/core/hcd.h
+++ b/drivers/usb/core/hcd.h
@@ -353,9 +353,6 @@ extern struct semaphore usb_bus_list_lock;
extern void usb_bus_get (struct usb_bus *bus);
extern void usb_bus_put (struct usb_bus *bus);
-extern struct usb_interface *usb_ifnum_to_if (struct usb_device *dev,
- unsigned ifnum);
-
extern int usb_find_interface_driver (struct usb_device *dev,
struct usb_interface *interface);
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index fdcc4607fe34..bd06a32f88d6 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -1484,6 +1484,7 @@ EXPORT_SYMBOL(usb_interface_claimed);
EXPORT_SYMBOL(usb_driver_release_interface);
EXPORT_SYMBOL(usb_match_id);
EXPORT_SYMBOL(usb_find_interface);
+EXPORT_SYMBOL(usb_ifnum_to_if);
EXPORT_SYMBOL(usb_new_device);
EXPORT_SYMBOL(usb_reset_device);
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index d2eab6ff56ab..3b0ee27a4564 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -88,9 +88,12 @@ static int detect(struct SHT *sht)
/* register the host */
us->host = scsi_register(sht, sizeof(us));
if (us->host) {
+ struct usb_interface *iface;
us->host->hostdata[0] = (unsigned long)us;
us->host_no = us->host->host_no;
- scsi_set_device(us->host, &us->pusb_dev->dev);
+ iface = usb_ifnum_to_if(us->pusb_dev, us->ifnum);
+ if (iface)
+ scsi_set_device(us->host, &iface->dev);
return 1;
}
diff --git a/include/linux/usb.h b/include/linux/usb.h
index bcbfa72423c3..9f465bfd8179 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -277,7 +277,9 @@ extern void usb_driver_release_interface(struct usb_driver *driver,
const struct usb_device_id *usb_match_id(struct usb_interface *interface,
const struct usb_device_id *id);
-struct usb_interface *usb_find_interface(struct usb_driver *drv, kdev_t kdev);
+extern struct usb_interface *usb_find_interface(struct usb_driver *drv, kdev_t kdev);
+extern struct usb_interface *usb_ifnum_to_if(struct usb_device *dev, unsigned ifnum);
+
/**
* usb_make_path - returns stable device path in the usb tree