diff options
author | Simon Glass <sjg@chromium.org> | 2016-05-14 14:03:03 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2016-05-27 10:23:08 -0600 |
commit | 5461acba44b7da8292ba2cbeaf961279d9b8c187 (patch) | |
tree | 3236da201a4e8217b21aa52c047d3e75523a7426 /common/env_mmc.c | |
parent | 3c2d75269cb4c94c445be2f77adcbca4add70893 (diff) |
dm: env: mmc: Convert env_mmc to support CONFIG_BLK
Update the MMC environment code so that it works with driver-model enabled
for block devices.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/env_mmc.c')
-rw-r--r-- | common/env_mmc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/common/env_mmc.c b/common/env_mmc.c index c7fef188cd..16f6a17514 100644 --- a/common/env_mmc.c +++ b/common/env_mmc.c @@ -128,12 +128,12 @@ static inline int write_env(struct mmc *mmc, unsigned long size, unsigned long offset, const void *buffer) { uint blk_start, blk_cnt, n; + struct blk_desc *desc = mmc_get_blk_desc(mmc); 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(&mmc->block_dev, blk_start, - blk_cnt, (u_char *)buffer); + n = blk_dwrite(desc, blk_start, blk_cnt, (u_char *)buffer); return (n == blk_cnt) ? 0 : -1; } @@ -197,12 +197,12 @@ static inline int read_env(struct mmc *mmc, unsigned long size, unsigned long offset, const void *buffer) { uint blk_start, blk_cnt, n; + struct blk_desc *desc = mmc_get_blk_desc(mmc); 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(&mmc->block_dev, blk_start, blk_cnt, - (uchar *)buffer); + n = blk_dread(desc, blk_start, blk_cnt, (uchar *)buffer); return (n == blk_cnt) ? 0 : -1; } |