summaryrefslogtreecommitdiff
path: root/cmd/disk.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-02-29 22:25:52 (GMT)
committerSimon Glass <sjg@chromium.org>2016-03-14 21:34:50 (GMT)
commit2a981dc2c62c500110aad297fa70503aec36e689 (patch)
treea2098718e857b136986ee0401a40037b16e51a3a /cmd/disk.c
parentbcce53d048de7f41078d25e39aa2f26d752d3658 (diff)
downloadu-boot-2a981dc2c62c500110aad297fa70503aec36e689.tar.xz
dm: block: Adjust device calls to go through helpers function
To ease conversion to driver model, add helper functions which deal with calling each block device method. With driver model we can reimplement these functions with the same arguments. Use inline functions to avoid increasing code size on some boards. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'cmd/disk.c')
-rw-r--r--cmd/disk.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/disk.c b/cmd/disk.c
index 27ed115..e0219f8 100644
--- a/cmd/disk.c
+++ b/cmd/disk.c
@@ -56,7 +56,7 @@ int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
", Block Size: %ld\n",
info.start, info.size, info.blksz);
- if (dev_desc->block_read(dev_desc, info.start, 1, (ulong *)addr) != 1) {
+ if (blk_dread(dev_desc, info.start, 1, (ulong *)addr) != 1) {
printf("** Read error on %d:%d\n", dev, part);
bootstage_error(BOOTSTAGE_ID_IDE_PART_READ);
return 1;
@@ -100,8 +100,8 @@ int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
cnt /= info.blksz;
cnt -= 1;
- if (dev_desc->block_read(dev_desc, info.start + 1, cnt,
- (ulong *)(addr + info.blksz)) != cnt) {
+ if (blk_dread(dev_desc, info.start + 1, cnt,
+ (ulong *)(addr + info.blksz)) != cnt) {
printf("** Read error on %d:%d\n", dev, part);
bootstage_error(BOOTSTAGE_ID_IDE_READ);
return 1;