diff options
author | Michal Simek <michal.simek@xilinx.com> | 2018-05-30 09:57:42 +0200 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2018-09-11 10:58:41 +0200 |
commit | 550109691ec87a129fd5c5777e1211257ff3c6c9 (patch) | |
tree | fe11c142f63c80f2765318423519e85a88466d28 | |
parent | 65a6b3c2af673237bb524d22ef6ca8a213f9cd8f (diff) | |
download | u-boot-550109691ec87a129fd5c5777e1211257ff3c6c9.zip u-boot-550109691ec87a129fd5c5777e1211257ff3c6c9.tar.gz u-boot-550109691ec87a129fd5c5777e1211257ff3c6c9.tar.bz2 |
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 <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | cmd/fpga.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; } |