diff options
author | Stephen Warren <swarren@nvidia.com> | 2015-12-07 11:38:48 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-01-13 21:05:18 -0500 |
commit | 7c4213f6a52f35ff6ba2d97aa4eb04cbfc963b86 (patch) | |
tree | 8dfb6b9f5721891de191bad798b0533e3a0bf69a /common/cmd_mmc.c | |
parent | adc421e4cee8275cd99367b3b455ffbb5ead3990 (diff) | |
download | u-boot-7c4213f6a52f35ff6ba2d97aa4eb04cbfc963b86.tar.gz |
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/cmd_mmc.c')
-rw-r--r-- | common/cmd_mmc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c index a6b7313e4a..6b5c1ac110 100644 --- a/common/cmd_mmc.c +++ b/common/cmd_mmc.c @@ -351,7 +351,7 @@ static int do_mmc_read(cmd_tbl_t *cmdtp, int flag, printf("\nMMC read: dev # %d, block # %d, count %d ... ", curr_device, blk, cnt); - n = mmc->block_dev.block_read(curr_device, blk, cnt, addr); + n = mmc->block_dev.block_read(&mmc->block_dev, blk, cnt, addr); /* flush cache after read */ flush_cache((ulong)addr, cnt * 512); /* FIXME */ printf("%d blocks read: %s\n", n, (n == cnt) ? "OK" : "ERROR"); @@ -383,7 +383,7 @@ static int do_mmc_write(cmd_tbl_t *cmdtp, int flag, printf("Error: card is write protected!\n"); return CMD_RET_FAILURE; } - n = mmc->block_dev.block_write(curr_device, blk, cnt, addr); + n = mmc->block_dev.block_write(&mmc->block_dev, blk, cnt, addr); printf("%d blocks written: %s\n", n, (n == cnt) ? "OK" : "ERROR"); return (n == cnt) ? CMD_RET_SUCCESS : CMD_RET_FAILURE; @@ -411,7 +411,7 @@ static int do_mmc_erase(cmd_tbl_t *cmdtp, int flag, printf("Error: card is write protected!\n"); return CMD_RET_FAILURE; } - n = mmc->block_dev.block_erase(curr_device, blk, cnt); + n = mmc->block_dev.block_erase(&mmc->block_dev, blk, cnt); printf("%d blocks erased: %s\n", n, (n == cnt) ? "OK" : "ERROR"); return (n == cnt) ? CMD_RET_SUCCESS : CMD_RET_FAILURE; |