Message ID | 1433688642-19861-2-git-send-email-sjg@chromium.org |
---|---|
State | Accepted |
Delegated to: | Simon Glass |
Headers | show |
On Sun, Jun 7, 2015 at 10:50 PM, Simon Glass <sjg@chromium.org> wrote: > 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> > --- > > common/cmd_sf.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/common/cmd_sf.c b/common/cmd_sf.c > index 342021d..668df69 100644 > --- a/common/cmd_sf.c > +++ b/common/cmd_sf.c > @@ -300,8 +300,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); > -- Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
On Sunday, June 07, 2015 at 04:50:32 PM, Simon Glass wrote: > 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> Acked-by: Marek Vasut <marex@denx.de> Best regards, Marek Vasut
On 8 June 2015 at 13:55, Marek Vasut <marex@denx.de> wrote: > On Sunday, June 07, 2015 at 04:50:32 PM, Simon Glass wrote: >> 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> > > Acked-by: Marek Vasut <marex@denx.de> Reviewed-by: Jagan Teki <jteki@openedev.com> thanks!
On 8 June 2015 at 11:49, Jagan Teki <jteki@openedev.com> wrote: > On 8 June 2015 at 13:55, Marek Vasut <marex@denx.de> wrote: >> On Sunday, June 07, 2015 at 04:50:32 PM, Simon Glass wrote: >>> 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> >> >> Acked-by: Marek Vasut <marex@denx.de> > > Reviewed-by: Jagan Teki <jteki@openedev.com> Since this is part of a bug-fix series I'll apply it now. Applied to u-boot-x86.
diff --git a/common/cmd_sf.c b/common/cmd_sf.c index 342021d..668df69 100644 --- a/common/cmd_sf.c +++ b/common/cmd_sf.c @@ -300,8 +300,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);
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> --- common/cmd_sf.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)