]> Git Repo - J-u-boot.git/commitdiff
cmd: sf: Display errno on erase failure
authorSean Anderson <[email protected]>
Fri, 5 Feb 2021 04:11:06 +0000 (23:11 -0500)
committerJagan Teki <[email protected]>
Fri, 26 Feb 2021 10:17:07 +0000 (15:47 +0530)
If there is an error while erasing SPI flash, no errno is displayed. This
makes it difficult to determine the cause of the error. This change mirrors
the logic for write errors above.

Signed-off-by: Sean Anderson <[email protected]>
Reviewed-by: Bin Meng <[email protected]>
Reviewed-by: Pratyush Yadav <[email protected]>
Reviewed-by: Jagan Teki <[email protected]>
cmd/sf.c

index c0d6a8f8a06f00040a332f93b789188729a7ec30..de80fcd38b08a237753679d46e8f18fdf8016a58 100644 (file)
--- a/cmd/sf.c
+++ b/cmd/sf.c
@@ -344,8 +344,11 @@ static int do_spi_flash_erase(int argc, char *const argv[])
        }
 
        ret = spi_flash_erase(flash, offset, size);
-       printf("SF: %zu bytes @ %#x Erased: %s\n", (size_t)size, (u32)offset,
-              ret ? "ERROR" : "OK");
+       printf("SF: %zu bytes @ %#x Erased: ", (size_t)size, (u32)offset);
+       if (ret)
+               printf("ERROR %d\n", ret);
+       else
+               printf("OK\n");
 
        return ret == 0 ? 0 : 1;
 }
This page took 0.034508 seconds and 4 git commands to generate.