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 --- common/fb_mmc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/fb_mmc.c b/common/fb_mmc.c index da7949f..e3abcc8 100644 --- a/common/fb_mmc.c +++ b/common/fb_mmc.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -58,7 +59,7 @@ static int fb_mmc_sparse_write(struct sparse_storage *storage, struct blk_desc *dev_desc = sparse->dev_desc; int ret; - ret = dev_desc->block_write(dev_desc, offset, size, data); + ret = blk_dwrite(dev_desc, offset, size, data); if (!ret) return -EIO; @@ -84,7 +85,7 @@ static void write_raw_image(struct blk_desc *dev_desc, disk_partition_t *info, puts("Flashing Raw Image\n"); - blks = dev_desc->block_write(dev_desc, info->start, blkcnt, buffer); + blks = blk_dwrite(dev_desc, info->start, blkcnt, buffer); if (blks != blkcnt) { error("failed writing to device %d\n", dev_desc->devnum); fastboot_fail(response_str, "failed writing to device"); -- cgit v1.1