summaryrefslogtreecommitdiffstats
path: root/common/env_mmc.c
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2015-12-07 11:38:48 -0700
committerTom Rini <trini@konsulko.com>2016-01-13 21:05:18 -0500
commit7c4213f6a52f35ff6ba2d97aa4eb04cbfc963b86 (patch)
tree8dfb6b9f5721891de191bad798b0533e3a0bf69a /common/env_mmc.c
parentadc421e4cee8275cd99367b3b455ffbb5ead3990 (diff)
downloadblackbird-obmc-uboot-7c4213f6a52f35ff6ba2d97aa4eb04cbfc963b86.tar.gz
blackbird-obmc-uboot-7c4213f6a52f35ff6ba2d97aa4eb04cbfc963b86.zip
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/env_mmc.c')
-rw-r--r--common/env_mmc.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/common/env_mmc.c b/common/env_mmc.c
index 96398224cc..f182749e8b 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;
}
OpenPOWER on IntegriCloud