From: Ming Lei Date: Sat, 19 Jan 2013 11:30:30 +0000 (+0800) Subject: USB: storage: avoid scanning other targets for single target device X-Git-Tag: firefly_0821_release~3680^2~1079^2~55 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f4cc1834bdc47d0574ceffb728f256f67e1190ef;p=firefly-linux-kernel-4.4.55.git USB: storage: avoid scanning other targets for single target device 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 Acked-by: Alan Stern Acked-by: Matthew Dharm Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index 31b3e1a61bbd..07b3e5406f48 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c @@ -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)