diff options
author | Simon Glass | 2023-07-30 11:16:47 -0600 |
---|---|---|
committer | Simon Glass | 2023-08-10 18:34:54 -0600 |
commit | defa33ad29f8d2897e78fdef6218b2eeea6acf6d (patch) | |
tree | e5b2b40474a7ab8cd8d8b7a3546eb372c27cf6ae /boot | |
parent | 321d7b4d875a77552a969dd6ea5bbed2644fcb0c (diff) |
bootstd: cros: Correct reporting of I/O errors
Return -EIO when the read failed, rather than the number of blocks read.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot')
-rw-r--r-- | boot/bootmeth_cros.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/boot/bootmeth_cros.c b/boot/bootmeth_cros.c index aa19ae097f5..6179a547f74 100644 --- a/boot/bootmeth_cros.c +++ b/boot/bootmeth_cros.c @@ -106,7 +106,7 @@ static int cros_read_bootflow(struct udevice *dev, struct bootflow *bflow) return log_msg_ret("hdr", -ENOMEM); ret = blk_read(bflow->blk, info.start, num_blks, hdr); if (ret != num_blks) - return log_msg_ret("inf", ret); + return log_msg_ret("inf", -EIO); if (memcmp("CHROMEOS", hdr, 8)) return -ENOENT; @@ -125,7 +125,7 @@ static int cros_read_bootflow(struct udevice *dev, struct bootflow *bflow) bflow->blk->name, (ulong)info.start, num_blks); ret = blk_read(bflow->blk, (ulong)info.start + 0x80, num_blks, buf); if (ret != num_blks) - return log_msg_ret("inf", ret); + return log_msg_ret("inf", -EIO); base = map_to_sysmem(buf); setup = base + start - OFFSET_BASE - SETUP_OFFSET; |