dm: sandbox: Add driver-model block-device support for sandbox

Update the host driver to support driver model for block devices. A future
commit will remove the old code, but for now it is useful to be able to use
it both with and without CONFIG_BLK.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Stephen Warren <swarren@nvidia.com>
This commit is contained in:
Simon Glass
2016-02-29 15:25:57 -07:00
parent 7ded959e4d
commit 40fd050890
3 changed files with 127 additions and 2 deletions

View File

@@ -5,6 +5,7 @@
*/
#include <common.h>
#include <dm.h>
#include <fs.h>
#include <part.h>
#include <sandboxblockdev.h>
@@ -80,7 +81,13 @@ static int do_host_info(cmd_tbl_t *cmdtp, int flag, int argc,
continue;
}
struct host_block_dev *host_dev = blk_dev->priv;
struct host_block_dev *host_dev;
#ifdef CONFIG_BLK
host_dev = dev_get_priv(blk_dev->bdev);
#else
host_dev = blk_dev->priv;
#endif
printf("%12lu %s\n", (unsigned long)blk_dev->lba,
host_dev->filename);
}