Commit 73671dad authored by Thomas Betker's avatar Thomas Betker Committed by Tom Rini

Check run_command() return code properly

run_command() returns 0 for success, 1 for failure. Fix places which
assume that failure is indicated by a negative return code.
Signed-off-by: default avatarThomas Betker <thomas.betker@rohde-schwarz.com>
Acked-by: default avatarSimon Glass <sjg@chromium.org>
Tested-by: default avatarSimon Glass <sjg@chromium.org>
Tested-by: default avatarStefan Roese <sr@denx.de>
parent 32e2c42a
......@@ -210,7 +210,7 @@ static void kw_sysrst_action(void)
debug("Starting %s process...\n", __FUNCTION__);
ret = run_command(s, 0);
if (ret < 0)
if (ret != 0)
debug("Error.. %s failed\n", __FUNCTION__);
else
debug("%s process finished\n", __FUNCTION__);
......
......@@ -221,11 +221,7 @@ void hw_watchdog_reset(void)
#ifdef CONFIG_TRAILBLAZER
int do_bootd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int rcode = 0;
if (run_command(getenv("bootcmd"), flag) < 0)
rcode = 1;
return rcode;
return run_command(getenv("bootcmd"), flag);
}
int board_early_init_r(void)
......
......@@ -1087,11 +1087,7 @@ U_BOOT_CMD(
#if defined(CONFIG_CMD_BOOTD)
int do_bootd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int rcode = 0;
if (run_command(getenv("bootcmd"), flag) < 0)
rcode = 1;
return rcode;
return run_command(getenv("bootcmd"), flag);
}
U_BOOT_CMD(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment