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.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index 6c10c888f35f..43576ed31ccd 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -76,6 +76,8 @@
76#include "uas-detect.h" 76#include "uas-detect.h"
77#endif 77#endif
78 78
79#define DRV_NAME "usb-storage"
80
79/* Some informational data */ 81/* Some informational data */
80MODULE_AUTHOR("Matthew Dharm <mdharm-usb@one-eyed-alien.net>"); 82MODULE_AUTHOR("Matthew Dharm <mdharm-usb@one-eyed-alien.net>");
81MODULE_DESCRIPTION("USB Mass Storage driver for Linux"); 83MODULE_DESCRIPTION("USB Mass Storage driver for Linux");
@@ -924,7 +926,8 @@ static unsigned int usb_stor_sg_tablesize(struct usb_interface *intf)
924int usb_stor_probe1(struct us_data **pus, 926int usb_stor_probe1(struct us_data **pus,
925 struct usb_interface *intf, 927 struct usb_interface *intf,
926 const struct usb_device_id *id, 928 const struct usb_device_id *id,
927 struct us_unusual_dev *unusual_dev) 929 struct us_unusual_dev *unusual_dev,
930 struct scsi_host_template *sht)
928{ 931{
929 struct Scsi_Host *host; 932 struct Scsi_Host *host;
930 struct us_data *us; 933 struct us_data *us;
@@ -936,7 +939,7 @@ int usb_stor_probe1(struct us_data **pus,
936 * Ask the SCSI layer to allocate a host structure, with extra 939 * Ask the SCSI layer to allocate a host structure, with extra
937 * space at the end for our private us_data structure. 940 * space at the end for our private us_data structure.
938 */ 941 */
939 host = scsi_host_alloc(&usb_stor_host_template, sizeof(*us)); 942 host = scsi_host_alloc(sht, sizeof(*us));
940 if (!host) { 943 if (!host) {
941 dev_warn(&intf->dev, "Unable to allocate the scsi host\n"); 944 dev_warn(&intf->dev, "Unable to allocate the scsi host\n");
942 return -ENOMEM; 945 return -ENOMEM;
@@ -1073,6 +1076,8 @@ void usb_stor_disconnect(struct usb_interface *intf)
1073} 1076}
1074EXPORT_SYMBOL_GPL(usb_stor_disconnect); 1077EXPORT_SYMBOL_GPL(usb_stor_disconnect);
1075 1078
1079static struct scsi_host_template usb_stor_host_template;
1080
1076/* The main probe routine for standard devices */ 1081/* The main probe routine for standard devices */
1077static int storage_probe(struct usb_interface *intf, 1082static int storage_probe(struct usb_interface *intf,
1078 const struct usb_device_id *id) 1083 const struct usb_device_id *id)
@@ -1113,7 +1118,8 @@ static int storage_probe(struct usb_interface *intf,
1113 id->idVendor, id->idProduct); 1118 id->idVendor, id->idProduct);
1114 } 1119 }
1115 1120
1116 result = usb_stor_probe1(&us, intf, id, unusual_dev); 1121 result = usb_stor_probe1(&us, intf, id, unusual_dev,
1122 &usb_stor_host_template);
1117 if (result) 1123 if (result)
1118 return result; 1124 return result;
1119 1125
@@ -1124,7 +1130,7 @@ static int storage_probe(struct usb_interface *intf,
1124} 1130}
1125 1131
1126static struct usb_driver usb_storage_driver = { 1132static struct usb_driver usb_storage_driver = {
1127 .name = "usb-storage", 1133 .name = DRV_NAME,
1128 .probe = storage_probe, 1134 .probe = storage_probe,
1129 .disconnect = usb_stor_disconnect, 1135 .disconnect = usb_stor_disconnect,
1130 .suspend = usb_stor_suspend, 1136 .suspend = usb_stor_suspend,
@@ -1137,4 +1143,4 @@ static struct usb_driver usb_storage_driver = {
1137 .soft_unbind = 1, 1143 .soft_unbind = 1,
1138}; 1144};
1139 1145
1140module_usb_driver(usb_storage_driver); 1146module_usb_stor_driver(usb_storage_driver, usb_stor_host_template, DRV_NAME);