]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
cmd: change the return value when argc error
authorShenlin Liang <liangshenlin@eswincomputing.com>
Fri, 9 Dec 2022 09:17:43 +0000 (17:17 +0800)
committerTom Rini <trini@konsulko.com>
Wed, 11 Jan 2023 16:54:50 +0000 (11:54 -0500)
When the number of parameters is wrong, the return value should be processed in
the same way as other cmds, return CMD_RET_USAGE so that it can print the information.

Signed-off-by: Shenlin Liang <liangshenlin@eswincomputing.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
cmd/mvebu/comphy_rx_training.c

index 25a9e153de8de721622652893eaec3cdfd7395ec..4ee8f54ea9c7ab839bdbae52a578d067010b6b8a 100644 (file)
@@ -22,7 +22,7 @@ int mvebu_comphy_rx_training_cmd(struct cmd_tbl *cmdtp, int flag, int argc,
 
        if (argc != 3) {
                printf("missing arguments\n");
-               return -1;
+               return CMD_RET_USAGE;
        }
 
        cp_index = hextoul(argv[1], NULL);