]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
bootstd: cros: Correct reporting of I/O errors
authorSimon Glass <sjg@chromium.org>
Sun, 30 Jul 2023 17:16:47 +0000 (11:16 -0600)
committerSimon Glass <sjg@chromium.org>
Fri, 11 Aug 2023 00:34:54 +0000 (18:34 -0600)
Return -EIO when the read failed, rather than the number of blocks read.

Signed-off-by: Simon Glass <sjg@chromium.org>
boot/bootmeth_cros.c

index aa19ae097f56f73bff1dad4067b6c25a1dbb5522..6179a547f74a8c9dc5fcaaa6542384285efae34c 100644 (file)
@@ -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;