diff options
author | Stephen Warren <swarren@nvidia.com> | 2015-12-07 18:38:48 (GMT) |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-01-14 02:05:18 (GMT) |
commit | 7c4213f6a52f35ff6ba2d97aa4eb04cbfc963b86 (patch) | |
tree | 8dfb6b9f5721891de191bad798b0533e3a0bf69a /common/fb_mmc.c | |
parent | adc421e4cee8275cd99367b3b455ffbb5ead3990 (diff) | |
download | u-boot-7c4213f6a52f35ff6ba2d97aa4eb04cbfc963b86.tar.xz |
block: pass block dev not num to read/write/erase()
This will allow the implementation to make use of data in the block_dev
structure beyond the base device number. This will be useful so that eMMC
block devices can encompass the HW partition ID rather than treating this
out-of-band. Equally, the existence of the priv field is crying out for
this patch to exist.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'common/fb_mmc.c')
-rw-r--r-- | common/fb_mmc.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/common/fb_mmc.c b/common/fb_mmc.c index b480e76..6e742da 100644 --- a/common/fb_mmc.c +++ b/common/fb_mmc.c @@ -58,7 +58,7 @@ static int fb_mmc_sparse_write(struct sparse_storage *storage, block_dev_desc_t *dev_desc = sparse->dev_desc; int ret; - ret = dev_desc->block_write(dev_desc->dev, offset, size, data); + ret = dev_desc->block_write(dev_desc, offset, size, data); if (!ret) return -EIO; @@ -84,8 +84,7 @@ static void write_raw_image(block_dev_desc_t *dev_desc, disk_partition_t *info, puts("Flashing Raw Image\n"); - blks = dev_desc->block_write(dev_desc->dev, info->start, blkcnt, - buffer); + blks = dev_desc->block_write(dev_desc, info->start, blkcnt, buffer); if (blks != blkcnt) { error("failed writing to device %d\n", dev_desc->dev); fastboot_fail(response_str, "failed writing to device"); @@ -206,7 +205,7 @@ void fb_mmc_erase(const char *cmd, char *response) printf("Erasing blocks " LBAFU " to " LBAFU " due to alignment\n", blks_start, blks_start + blks_size); - blks = dev_desc->block_erase(dev_desc->dev, blks_start, blks_size); + blks = dev_desc->block_erase(dev_desc, blks_start, blks_size); if (blks != blks_size) { error("failed erasing from device %d", dev_desc->dev); fastboot_fail(response_str, "failed erasing from device"); |