Skip to content

Commit

Permalink
usb: return 0 from usb_stor_get_info even if removable media
Browse files Browse the repository at this point in the history
This fixes a regression caused by

commit 07b2b78
    dm: usb: Convert USB storage to use driver-model for block devs

which caused part_init to be called when it was not previously.
Without this patch, the following happens when a USB sd card reader is used.

=> usb start
starting USB...
USB0:   Port not available.
USB1:   USB EHCI 1.00
scanning bus 1 for devices... 3 USB Device(s) found
       scanning usb for storage devices... Device NOT ready
   Request Sense returned 02 3A 00
 ### ERROR ### Please RESET the board ###

This happens because dev_desc->blksz is 0.

Signed-off-by: Troy Kisky <[email protected]>
  • Loading branch information
tkisky authored and Marek Vasut committed Apr 14, 2017
1 parent 57ca63b commit 1e5eca7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions common/usb_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -1440,10 +1440,8 @@ int usb_stor_get_info(struct usb_device *dev, struct us_data *ss,
" Request Sense returned %02X %02X %02X\n",
pccb->sense_buf[2], pccb->sense_buf[12],
pccb->sense_buf[13]);
if (dev_desc->removable == 1) {
if (dev_desc->removable == 1)
dev_desc->type = perq;
return 1;
}
return 0;
}
pccb->pdata = (unsigned char *)cap;
Expand Down

0 comments on commit 1e5eca7

Please sign in to comment.