From: Simon Glass Date: Sun, 7 Jun 2015 14:50:32 +0000 (-0600) Subject: spi: sf: Print the error code on failure X-Git-Tag: v2015.10-rc1~190^2~53 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a7d0711a2486b7420a938831512d859879e613cb;p=u-boot spi: sf: Print the error code on failure Rather than just 'ERROR', display the error code, which may be useful, at least with driver model. Signed-off-by: Simon Glass Reviewed-by: Bin Meng Acked-by: Marek Vasut Reviewed-by: Jagan Teki --- diff --git a/common/cmd_sf.c b/common/cmd_sf.c index aef8c2a5ea..3746e0d964 100644 --- a/common/cmd_sf.c +++ b/common/cmd_sf.c @@ -303,8 +303,12 @@ static int do_spi_flash_read_write(int argc, char * const argv[]) else ret = spi_flash_write(flash, offset, len, buf); - printf("SF: %zu bytes @ %#x %s: %s\n", (size_t)len, (u32)offset, - read ? "Read" : "Written", ret ? "ERROR" : "OK"); + printf("SF: %zu bytes @ %#x %s: ", (size_t)len, (u32)offset, + read ? "Read" : "Written"); + if (ret) + printf("ERROR %d\n", ret); + else + printf("OK\n"); } unmap_physmem(buf, len);