diff options
author | Simon Glass <sjg@chromium.org> | 2016-02-29 22:25:52 (GMT) |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2016-03-14 21:34:50 (GMT) |
commit | 2a981dc2c62c500110aad297fa70503aec36e689 (patch) | |
tree | a2098718e857b136986ee0401a40037b16e51a3a /disk/part_dos.c | |
parent | bcce53d048de7f41078d25e39aa2f26d752d3658 (diff) | |
download | u-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 'disk/part_dos.c')
-rw-r--r-- | disk/part_dos.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/disk/part_dos.c b/disk/part_dos.c index 5f8d949..0ed1374 100644 --- a/disk/part_dos.c +++ b/disk/part_dos.c @@ -91,7 +91,7 @@ static int test_part_dos(struct blk_desc *dev_desc) { ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz); - if (dev_desc->block_read(dev_desc, 0, 1, (ulong *)buffer) != 1) + if (blk_dread(dev_desc, 0, 1, (ulong *)buffer) != 1) return -1; if (test_block_type(buffer) != DOS_MBR) @@ -111,8 +111,7 @@ static void print_partition_extended(struct blk_desc *dev_desc, dos_partition_t *pt; int i; - if (dev_desc->block_read(dev_desc, ext_part_sector, 1, - (ulong *)buffer) != 1) { + if (blk_dread(dev_desc, ext_part_sector, 1, (ulong *)buffer) != 1) { printf ("** Can't read partition table on %d:" LBAFU " **\n", dev_desc->devnum, ext_part_sector); return; @@ -177,8 +176,7 @@ static int part_get_info_extended(struct blk_desc *dev_desc, int i; int dos_type; - if (dev_desc->block_read(dev_desc, ext_part_sector, 1, - (ulong *)buffer) != 1) { + if (blk_dread(dev_desc, ext_part_sector, 1, (ulong *)buffer) != 1) { printf ("** Can't read partition table on %d:" LBAFU " **\n", dev_desc->devnum, ext_part_sector); return -1; |