]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Check run_command() return code properly
authorThomas Betker <thomas.betker@freenet.de>
Thu, 5 Jun 2014 18:07:56 +0000 (20:07 +0200)
committerTom Rini <trini@ti.com>
Wed, 11 Jun 2014 20:25:47 +0000 (16:25 -0400)
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: Thomas Betker <thomas.betker@rohde-schwarz.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Tested-by: Stefan Roese <sr@denx.de>
arch/arm/cpu/arm926ejs/kirkwood/cpu.c
board/gdsys/p1022/controlcenterd.c
common/cmd_bootm.c

index 093750626886d48c1c3f3a99077506eb21c2d0e2..da80240052616bf29904f2005d500663b853ad7e 100644 (file)
@@ -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__);
index 8ccd9ce6baa2c9e7e080d01cd9a2da47c0aa69df..642b807e801bca8e01d4348d33cab210583e3fce 100644 (file)
@@ -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)
index 9b11c0ea18e64b6f09baceb9c1bd778d43afb832..c06f4b730f363e64826531dc2d3fd8b0b85a51cf 100644 (file)
@@ -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(