aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/storage/usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/storage/usb.c')
-rw-r--r--drivers/usb/storage/usb.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index db51ba16dc07..c18538e4a6db 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -125,6 +125,9 @@ static struct us_unusual_dev us_unusual_dev_list[] = {
125 { } /* Terminating entry */ 125 { } /* Terminating entry */
126}; 126};
127 127
128static struct us_unusual_dev for_dynamic_ids =
129 USUAL_DEV(USB_SC_SCSI, USB_PR_BULK, 0);
130
128#undef UNUSUAL_DEV 131#undef UNUSUAL_DEV
129#undef COMPLIANT_DEV 132#undef COMPLIANT_DEV
130#undef USUAL_DEV 133#undef USUAL_DEV
@@ -999,8 +1002,10 @@ EXPORT_SYMBOL_GPL(usb_stor_disconnect);
999static int storage_probe(struct usb_interface *intf, 1002static int storage_probe(struct usb_interface *intf,
1000 const struct usb_device_id *id) 1003 const struct usb_device_id *id)
1001{ 1004{
1005 struct us_unusual_dev *unusual_dev;
1002 struct us_data *us; 1006 struct us_data *us;
1003 int result; 1007 int result;
1008 int size;
1004 1009
1005 /* 1010 /*
1006 * If libusual is configured, let it decide whether a standard 1011 * If libusual is configured, let it decide whether a standard
@@ -1019,8 +1024,19 @@ static int storage_probe(struct usb_interface *intf,
1019 * table, so we use the index of the id entry to find the 1024 * table, so we use the index of the id entry to find the
1020 * corresponding unusual_devs entry. 1025 * corresponding unusual_devs entry.
1021 */ 1026 */
1022 result = usb_stor_probe1(&us, intf, id, 1027
1023 (id - usb_storage_usb_ids) + us_unusual_dev_list); 1028 size = ARRAY_SIZE(us_unusual_dev_list);
1029 if (id >= usb_storage_usb_ids && id < usb_storage_usb_ids + size) {
1030 unusual_dev = (id - usb_storage_usb_ids) + us_unusual_dev_list;
1031 } else {
1032 unusual_dev = &for_dynamic_ids;
1033
1034 US_DEBUGP("%s %s 0x%04x 0x%04x\n", "Use Bulk-Only transport",
1035 "with the Transparent SCSI protocol for dynamic id:",
1036 id->idVendor, id->idProduct);
1037 }
1038
1039 result = usb_stor_probe1(&us, intf, id, unusual_dev);
1024 if (result) 1040 if (result)
1025 return result; 1041 return result;
1026 1042
@@ -1046,7 +1062,6 @@ static struct usb_driver usb_storage_driver = {
1046 .id_table = usb_storage_usb_ids, 1062 .id_table = usb_storage_usb_ids,
1047 .supports_autosuspend = 1, 1063 .supports_autosuspend = 1,
1048 .soft_unbind = 1, 1064 .soft_unbind = 1,
1049 .no_dynamic_id = 1,
1050}; 1065};
1051 1066
1052static int __init usb_stor_init(void) 1067static int __init usb_stor_init(void)