dm: blk: Use uclass_find_first/next_device() in blk_first/next_device()
authorStefan Roese <sr@denx.de>
Wed, 29 Nov 2017 15:46:42 +0000 (16:46 +0100)
committerSimon Glass <sjg@chromium.org>
Wed, 13 Dec 2017 02:53:45 +0000 (19:53 -0700)
commit8a5cbc065dfe1f258e3a7be823ea128184b90b5b
treee5bf72b1cf2ccd1be178ce72b82dd108b7842f7c
parentbf802f5d544f85c03b4097ab23d078be43c61855
dm: blk: Use uclass_find_first/next_device() in blk_first/next_device()

This patch changes the calls to uclass_first/next_device() in blk_first/
next_device() to use uclass_find_first/next_device() instead. These functions
don't prepare the devices, which is correct in this case.

With this patch applied, the "usb storage" command now works again as
expected:

=> usb storage
  Device 0: Vendor: SanDisk Rev: 1.00 Prod: Ultra
  Type: Removable Hard Disk
  Capacity: 58656.0 MB = 57.2 GB (120127488 x 512)

Without this patch, it used to generate this buggy output:

=> usb storage
Card did not respond to voltage select!
mmc_init: -95, time 26
No storage devices, perhaps not 'usb start'ed..?

Signed-off-by: Stefan Roese <sr@denx.de>
Suggested-by: Simon Glass <sjg@chromium.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/block/blk-uclass.c