Skip to content

Commit

Permalink
USB: storage: avoid scanning other targets for single target device
Browse files Browse the repository at this point in the history
This patch sets scsi_host->max_id as 1 if the device's quirk
flag of US_FL_SCM_MULT_TARG isn't set, because there are only 6
mass storage devices marked as mutiple targets from unusual_devs.h.

This patch is a small optimization about scanning targets, and
avoid scanning other 7 non-existed targets for single target
device.

Signed-off-by: Ming Lei <ming.lei@canonical.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Ming Lei authored and Greg Kroah-Hartman committed Jan 21, 2013
1 parent fde2638 commit f4cc183
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/usb/storage/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,9 @@ int usb_stor_probe2(struct us_data *us)
if (us->fflags & US_FL_SINGLE_LUN)
us->max_lun = 0;

if (!(us->fflags & US_FL_SCM_MULT_TARG))
us_to_host(us)->max_id = 1;

/* Find the endpoints and calculate pipe values */
result = get_pipes(us);
if (result)
Expand Down

0 comments on commit f4cc183

Please sign in to comment.