mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-19 11:24:42 +00:00
vbe: Use blk_read() to read blocks
We should not be using the old blk_d...() interface, is only there to aid migration to driver model. Move to blk_read() instead. Changes in v2: - Split patch into several pieces Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
21dd873572
commit
a1c456d199
1 changed files with 2 additions and 2 deletions
|
@ -44,7 +44,7 @@ static int simple_read_version(struct udevice *dev, struct blk_desc *desc,
|
||||||
return log_msg_ret("get", -EBADF);
|
return log_msg_ret("get", -EBADF);
|
||||||
start /= MMC_MAX_BLOCK_LEN;
|
start /= MMC_MAX_BLOCK_LEN;
|
||||||
|
|
||||||
if (blk_dread(desc, start, 1, buf) != 1)
|
if (blk_read(desc->bdev, start, 1, buf) != 1)
|
||||||
return log_msg_ret("read", -EIO);
|
return log_msg_ret("read", -EIO);
|
||||||
strlcpy(state->fw_version, buf, MAX_VERSION_LEN);
|
strlcpy(state->fw_version, buf, MAX_VERSION_LEN);
|
||||||
log_debug("version=%s\n", state->fw_version);
|
log_debug("version=%s\n", state->fw_version);
|
||||||
|
@ -68,7 +68,7 @@ static int simple_read_nvdata(struct udevice *dev, struct blk_desc *desc,
|
||||||
return log_msg_ret("get", -EBADF);
|
return log_msg_ret("get", -EBADF);
|
||||||
start /= MMC_MAX_BLOCK_LEN;
|
start /= MMC_MAX_BLOCK_LEN;
|
||||||
|
|
||||||
if (blk_dread(desc, start, 1, buf) != 1)
|
if (blk_read(desc->bdev, start, 1, buf) != 1)
|
||||||
return log_msg_ret("read", -EIO);
|
return log_msg_ret("read", -EIO);
|
||||||
nvd = (struct simple_nvdata *)buf;
|
nvd = (struct simple_nvdata *)buf;
|
||||||
hdr_ver = (nvd->hdr & NVD_HDR_VER_MASK) >> NVD_HDR_VER_SHIFT;
|
hdr_ver = (nvd->hdr & NVD_HDR_VER_MASK) >> NVD_HDR_VER_SHIFT;
|
||||||
|
|
Loading…
Add table
Reference in a new issue