From a8a508270be28d5d234e760cc3406cfad188b1d2 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Tue, 11 Jun 2019 11:12:22 +0200 Subject: commands: don't use stale errno when calling fb_open fb_open returns a pointer and doesn't populate errno, which will result in a stale errno being evaluated by perror() on failure. Fix this by using strerror with the proper argument instead at call sites. While at it, correct the message prefix typo (s/fb_open/fb_open/). Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- commands/fbtest.c | 5 +++-- commands/splash.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'commands') diff --git a/commands/fbtest.c b/commands/fbtest.c index e5dd8ba7fa..ff24a8252a 100644 --- a/commands/fbtest.c +++ b/commands/fbtest.c @@ -271,8 +271,9 @@ static int do_fbtest(int argc, char *argv[]) sc = fb_open(fbdev); if (IS_ERR(sc)) { - perror("fd_open"); - return PTR_ERR(sc); + int ret = -PTR_ERR(sc); + printf("fb_open: %s\n", strerror(ret)); + return ret; } if (!pattern_name) { diff --git a/commands/splash.c b/commands/splash.c index 2b70b29683..abd82873cb 100644 --- a/commands/splash.c +++ b/commands/splash.c @@ -54,8 +54,9 @@ static int do_splash(int argc, char *argv[]) sc = fb_open(fbdev); if (IS_ERR(sc)) { - perror("fd_open"); - return PTR_ERR(sc); + int ret = -PTR_ERR(sc); + printf("fb_open: %s\n", strerror(ret)); + return ret; } buf = gui_screen_render_buffer(sc); -- cgit v1.2.3 From 63752a90a38439f6ef39613c5b9e48e5b40531a7 Mon Sep 17 00:00:00 2001 From: Marco Felsch Date: Mon, 17 Jun 2019 12:00:55 +0200 Subject: commands: mmc_extcsd: fix extcsd value meanings As specified by the JEDEC Standard No. 84-A441 the RESET_BOOT_BUS_WIDTH (Bit[2]) is specified the other way around. Also the BOOT_MODE is a two bit register. Signed-off-by: Marco Felsch Signed-off-by: Sascha Hauer --- commands/mmc_extcsd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'commands') diff --git a/commands/mmc_extcsd.c b/commands/mmc_extcsd.c index 889a6c614a..c27bb722ea 100644 --- a/commands/mmc_extcsd.c +++ b/commands/mmc_extcsd.c @@ -861,10 +861,10 @@ static int print_field(u8 *reg, int index) str); val = get_field_val(EXT_CSD_BOOT_BUS_CONDITIONS, 2, 0x1); if (val) - str = "Reset bus width to x1, SDR and backward compatible timings after boot operation"; - else str = "Retain BOOT_BUS_WIDTH and BOOT_MODE values after boot operation"; - printf("\t[2] RESET_BOOT_BUS_CONDITIONS: %s", str); + else + str = "Reset bus width to x1, SDR and backward compatible timings after boot operation"; + printf("\t[2] RESET_BOOT_BUS_CONDITIONS: %s\n", str); val = get_field_val(EXT_CSD_BOOT_BUS_CONDITIONS, 3, 0x3); switch (val) { case 0x0: @@ -877,7 +877,7 @@ static int print_field(u8 *reg, int index) str = "Use DDR in boot operation"; break; } - printf("\t[3] BOOT_MODE: %s\n", str); + printf("\t[4-3] BOOT_MODE: %s\n", str); return 1; case EXT_CSD_BOOT_CONFIG_PROT: -- cgit v1.2.3