From 2a981dc2c62c500110aad297fa70503aec36e689 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 29 Feb 2016 15:25:52 -0700 Subject: 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 Reviewed-by: Bin Meng Tested-by: Stephen Warren --- disk/part_amiga.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'disk/part_amiga.c') diff --git a/disk/part_amiga.c b/disk/part_amiga.c index d323b4b..4a67689 100644 --- a/disk/part_amiga.c +++ b/disk/part_amiga.c @@ -140,7 +140,7 @@ struct rigid_disk_block *get_rdisk(struct blk_desc *dev_desc) for (i=0; iblock_read(dev_desc, i, 1, (ulong *)block_buffer); + ulong res = blk_dread(dev_desc, i, 1, (ulong *)block_buffer); if (res == 1) { struct rigid_disk_block *trdb = (struct rigid_disk_block *)block_buffer; @@ -182,7 +182,7 @@ struct bootcode_block *get_bootcode(struct blk_desc *dev_desc) for (i = 0; i < limit; i++) { - ulong res = dev_desc->block_read(dev_desc, i, 1, (ulong *)block_buffer); + ulong res = blk_dread(dev_desc, i, 1, (ulong *)block_buffer); if (res == 1) { struct bootcode_block *boot = (struct bootcode_block *)block_buffer; @@ -258,8 +258,7 @@ static struct partition_block *find_partition(struct blk_desc *dev_desc, while (block != 0xFFFFFFFF) { - ulong res = dev_desc->block_read(dev_desc, block, 1, - (ulong *)block_buffer); + ulong res = blk_dread(dev_desc, block, 1, (ulong *)block_buffer); if (res == 1) { p = (struct partition_block *)block_buffer; @@ -355,7 +354,7 @@ static void print_part_amiga(struct blk_desc *dev_desc) PRINTF("Trying to load block #0x%X\n", block); - res = dev_desc->block_read(dev_desc, block, 1, (ulong *)block_buffer); + res = blk_dread(dev_desc, block, 1, (ulong *)block_buffer); if (res == 1) { p = (struct partition_block *)block_buffer; -- cgit v1.1