summaryrefslogtreecommitdiff
path: root/common/fb_mmc.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 /common/fb_mmc.c
parentbcce53d048de7f41078d25e39aa2f26d752d3658 (diff)
downloadu-boot-fsl-qoriq-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 'common/fb_mmc.c')
-rw-r--r--common/fb_mmc.c5
1 files changed, 3 insertions, 2 deletions
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 <config.h>
#include <common.h>
+#include <blk.h>
#include <errno.h>
#include <fastboot.h>
#include <fb_mmc.h>
@@ -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");