summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-06-07 08:50:32 -0600
committerSimon Glass <sjg@chromium.org>2015-07-14 18:03:15 -0600
commita7d0711a2486b7420a938831512d859879e613cb (patch)
tree2065769204ee3ab7a23189d3b1513f28bf55792e /common
parentaefaff8ed83472da5ba96e179231eee665e2d843 (diff)
downloadu-boot-imx-a7d0711a2486b7420a938831512d859879e613cb.zip
u-boot-imx-a7d0711a2486b7420a938831512d859879e613cb.tar.gz
u-boot-imx-a7d0711a2486b7420a938831512d859879e613cb.tar.bz2
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 <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Marek Vasut <marex@denx.de> Reviewed-by: Jagan Teki <jteki@openedev.com>
Diffstat (limited to 'common')
-rw-r--r--common/cmd_sf.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/common/cmd_sf.c b/common/cmd_sf.c
index aef8c2a..3746e0d 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);