usb: return 0 from usb_stor_get_info even if removable media 84/206384/1 accepted/tizen/unified/20190602.221836 submit/tizen/20190530.011954
authorTroy Kisky <troy.kisky@boundarydevices.com>
Tue, 11 Apr 2017 01:23:11 +0000 (18:23 -0700)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Fri, 17 May 2019 07:31:08 +0000 (16:31 +0900)
commitbd8be1adf794742ba78fe7728f4b86e546c2ccbb
tree0e5835b5b5a6d0d8e3635cad5c94a0286739189c
parente5b7e775076bc04728a79854db038652db7f5c9c
usb: return 0 from usb_stor_get_info even if removable media

This fixes a regression caused by

commit 07b2b78ce4bc8ae25e066c65245eaf58c0d9a67c
    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 <troy.kisky@boundarydevices.com>
[sw0312.kim: cherry-pick mainline commit 1e5eca7d4225 to fix divsion by zero issue with empty sdcard reader]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I13f09d9fcfb078a3f443d3500112c12a89c4fec2
common/usb_storage.c