
Recent additions of the MMC and DISK uclasses have indicated that it is time to look at adding a uclass for block devices. This series does this and includes a few clean-ups to the partition code also.
A block device is typically a child device of its storage parent. For example an MMC device will have a block-device child. A USB storage device may have multiple block-device children, one for each LUN.
With this series only USB storage and 'host' are converted over to use the new support. Several more remain, including SCSI, IDE and MMC. Each of these should get its own uclass.
The uclass implements only a few basic features. A few tests are added to check that things work as expected.
The code size impact of switching to driver model for block devices is small. One benefit is that it becomes possible to enumerate all block devices, regardless of their type.
Changes in v3: - Expand the commit message - Drop patches already applied
Changes in v2: - Rename to blk_get_device_by_str()
Simon Glass (4): dm: usb: Unbind old block devices when shutting down USB dm: sandbox: Switch over to use DM for block devices dm: sandbox: Drop the pre-DM host implementation dm: blk: Add tests for block devices
configs/sandbox_defconfig | 1 + drivers/block/sandbox.c | 90 ---------------------------------------- drivers/usb/host/usb-uclass.c | 6 ++- test/dm/Makefile | 1 + test/dm/blk.c | 96 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 103 insertions(+), 91 deletions(-) create mode 100644 test/dm/blk.c