From 7c4213f6a52f35ff6ba2d97aa4eb04cbfc963b86 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Mon, 7 Dec 2015 11:38:48 -0700 Subject: 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 Reviewed-by: Tom Rini --- common/env_mmc.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'common/env_mmc.c') diff --git a/common/env_mmc.c b/common/env_mmc.c index 9639822..f182749 100644 --- a/common/env_mmc.c +++ b/common/env_mmc.c @@ -127,7 +127,7 @@ static inline int write_env(struct mmc *mmc, unsigned long size, blk_start = ALIGN(offset, mmc->write_bl_len) / mmc->write_bl_len; blk_cnt = ALIGN(size, mmc->write_bl_len) / mmc->write_bl_len; - n = mmc->block_dev.block_write(CONFIG_SYS_MMC_ENV_DEV, blk_start, + n = mmc->block_dev.block_write(&mmc->block_dev, blk_start, blk_cnt, (u_char *)buffer); return (n == blk_cnt) ? 0 : -1; @@ -192,16 +192,12 @@ static inline int read_env(struct mmc *mmc, unsigned long size, unsigned long offset, const void *buffer) { uint blk_start, blk_cnt, n; - int dev = CONFIG_SYS_MMC_ENV_DEV; - -#ifdef CONFIG_SPL_BUILD - dev = 0; -#endif blk_start = ALIGN(offset, mmc->read_bl_len) / mmc->read_bl_len; blk_cnt = ALIGN(size, mmc->read_bl_len) / mmc->read_bl_len; - n = mmc->block_dev.block_read(dev, blk_start, blk_cnt, (uchar *)buffer); + n = mmc->block_dev.block_read(&mmc->block_dev, blk_start, blk_cnt, + (uchar *)buffer); return (n == blk_cnt) ? 0 : -1; } -- cgit v1.1