summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-02-29 15:25:57 -0700
committerSimon Glass <sjg@chromium.org>2016-03-14 15:34:50 -0600
commit40fd050890e08eb6d064aaf074cf3a8b75d1251e (patch)
treec7833a964277e045db74e4f5e602efc23b8a9bde /cmd
parent7ded959e4d5b93c10a8b57a0a391fb35cefb85ce (diff)
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>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/host.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/cmd/host.c b/cmd/host.c
index ee219ce9145..8d84415301f 100644
--- a/cmd/host.c
+++ b/cmd/host.c
@@ -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);
}