[U-Boot] [PATCH] common: Use command_ret_t enum values instead of values

Michal Simek michal.simek at xilinx.com
Mon Jun 4 11:37:43 UTC 2018


Use enum command_ret_t types in cmd_process_error().
Also handle USAGE failure separately.

Signed-off-by: Michal Simek <michal.simek at xilinx.com>
---

 common/command.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/common/command.c b/common/command.c
index 52d47c133c3c..2433a89e0a8e 100644
--- a/common/command.c
+++ b/common/command.c
@@ -547,10 +547,13 @@ enum command_ret_t cmd_process(int flag, int argc, char * const argv[],
 
 int cmd_process_error(cmd_tbl_t *cmdtp, int err)
 {
+	if (err == CMD_RET_USAGE)
+		return CMD_RET_USAGE;
+
 	if (err) {
 		printf("Command '%s' failed: Error %d\n", cmdtp->name, err);
-		return 1;
+		return CMD_RET_FAILURE;
 	}
 
-	return 0;
+	return CMD_RET_SUCCESS;
 }
-- 
2.17.0



More information about the U-Boot mailing list