Skip to contentSkip to conversation

sierra-ms: do not call scsi_get_host_dev()

PATCH In review Hannes Reinecke 2 participants 2 messages May 5, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sierra-ms: do not call scsi_get_host_dev()

scsi_get_host_dev() will create a virtual device such that either the target id is ignored from scanning (if 'this_id' is set to something which can be reached during scanning) or if the driver needs a scsi device for the HBA to send commands to. Neither is true for sierra-ms; 'this_id' remains at the default value '-1' and the created device is never ever used within the driver.
So kill it.

---
 drivers/usb/storage/sierra_ms.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/usb/storage/sierra_ms.c +0 -4
index e605cbc3d8bf..b9f78ef3edc3 100644
@@ -129,15 +129,11 @@ int sierra_ms_init(struct us_data *us)
 	int result, retries;
 	struct swoc_info *swocInfo;
 	struct usb_device *udev;
-	struct Scsi_Host *sh;
 
 	retries = 3;
 	result = 0;
 	udev = us->pusb_dev;
 
-	sh = us_to_host(us);
-	scsi_get_host_dev(sh);
-
 	/* Force Modem mode */
 	if (swi_tru_install == TRU_FORCE_MODEM) {
 		usb_stor_dbg(us, "SWIMS: Forcing Modem Mode\n");
Signature · 1 line
2.16.4
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 25 lines · Hannes Reinecke

scsi_get_host_dev() will create a virtual device such that either the target id is ignored from scanning (if 'this_id' is set to something which can be reached during scanning) or if the driver needs a scsi device for the HBA to send commands to. Neither is true for sierra-ms; 'this_id' remains at the default value '-1' and the created device is never ever used within the driver.
So kill it.

---
 drivers/usb/storage/sierra_ms.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/usb/storage/sierra_ms.c +0 -1
index e605cbc3d8bf..b9f78ef3edc3 100644
@@ -129,15 +129,11 @@ int sierra_ms_init(struct us_data *us)
 	int result, retries;
 	struct swoc_info *swocInfo;
 	struct usb_device *udev;
-	struct Scsi_Host *sh;
 

drivers/usb/storage/sierra_ms.c int sierra_ms_init(struct us_data *us) · line 139

Quoted 10 lines
drivers/usb/storage/sierra_ms.c +0 -3
 	retries = 3;
 	result = 0;
 	udev = us->pusb_dev;
 
-	sh = us_to_host(us);
-	scsi_get_host_dev(sh);
-
 	/* Force Modem mode */
 	if (swi_tru_install == TRU_FORCE_MODEM) {
 		usb_stor_dbg(us, "SWIMS: Forcing Modem Mode\n");