From 550109691ec87a129fd5c5777e1211257ff3c6c9 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Wed, 30 May 2018 09:57:42 +0200 Subject: [PATCH] cmd: fpga: Move error handling to do_fpga() Clean fpga_get_op() error handling by moving checking/print to do_fpga. Signed-off-by: Michal Simek Reviewed-by: Simon Glass --- cmd/fpga.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/fpga.c b/cmd/fpga.c index 791fe5cb77..abe6837202 100644 --- a/cmd/fpga.c +++ b/cmd/fpga.c @@ -74,6 +74,9 @@ int do_fpga(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) op = (int)fpga_get_op(argv[1]); switch (op) { + case FPGA_NONE: + printf("Unknown fpga operation \"%s\"\n", argv[1]); + return CMD_RET_USAGE; #if defined(CONFIG_CMD_FPGA_LOADFS) case FPGA_LOADFS: if (argc < 9) @@ -360,9 +363,6 @@ static int fpga_get_op(char *opstr) op = FPGA_LOADS; #endif - if (op == FPGA_NONE) - printf("Unknown fpga operation \"%s\"\n", opstr); - return op; } -- 2.25.1