summaryrefslogtreecommitdiffstats
path: root/drivers/usb/storage/usb.c
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2019-05-22 00:33:48 -0700
committerSascha Hauer <s.hauer@pengutronix.de>2019-05-23 09:11:10 +0200
commit1e5a5b51a57363b441c4dd27774b186e715ab139 (patch)
treea0d3a481e231667507d057b56f5f01d5ff12d1cd /drivers/usb/storage/usb.c
parent85de58c03ccd20764dd5afa2efc8b2f1380c4259 (diff)
downloadbarebox-1e5a5b51a57363b441c4dd27774b186e715ab139.tar.gz
usb: storage: Default to a single LUN
For loop below is: for (lun=0; lun<=us->max_lun; lun++) ... so we need to set max_lun to 0 in order to default to having only one LUN. Otherwise, we end up assuming the device has 2 valid LUNs. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/usb/storage/usb.c')
-rw-r--r--drivers/usb/storage/usb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index fda24d6..79561ee 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -439,7 +439,7 @@ static int usb_stor_scan(struct usb_device *usbdev, struct us_data *us)
int num_devs = 0;
/* obtain the max LUN */
- us->max_lun = 1;
+ us->max_lun = 0;
if (us->protocol == US_PR_BULK)
us->max_lun = usb_stor_Bulk_max_lun(us);