diff mbox series

sierra-ms: do not call scsi_get_host_dev()

Message ID 20200505143019.57418-1-hare@suse.de (mailing list archive)
State Mainlined
Commit c22eb9374cb0f3936d1942d07e78855fd4e88846
Headers show
Series sierra-ms: do not call scsi_get_host_dev() | expand

Commit Message

Hannes Reinecke May 5, 2020, 2:30 p.m. UTC
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.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/usb/storage/sierra_ms.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Alan Stern May 5, 2020, 3:46 p.m. UTC | #1
On Tue, 5 May 2020, Hannes Reinecke wrote:

> 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.
> 
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
>  drivers/usb/storage/sierra_ms.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/usb/storage/sierra_ms.c b/drivers/usb/storage/sierra_ms.c
> index e605cbc3d8bf..b9f78ef3edc3 100644
> --- a/drivers/usb/storage/sierra_ms.c
> +++ b/drivers/usb/storage/sierra_ms.c
> @@ -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");
> 

Acked-by: Alan Stern <stern@rowland.harvard.edu>
diff mbox series

Patch

diff --git a/drivers/usb/storage/sierra_ms.c b/drivers/usb/storage/sierra_ms.c
index e605cbc3d8bf..b9f78ef3edc3 100644
--- a/drivers/usb/storage/sierra_ms.c
+++ b/drivers/usb/storage/sierra_ms.c
@@ -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");