diff options
author | Michal Simek | 2018-05-30 10:04:34 +0200 |
---|---|---|
committer | Michal Simek | 2018-09-11 10:58:41 +0200 |
commit | ccd65203275f74b5bb6fa8c7920627493c28e65f (patch) | |
tree | da78b87d3390b5148b453225421630c6b1383532 /cmd/fpga.c | |
parent | 323fe38e74a96a4585f04c356baa0b739e7b34b5 (diff) |
cmd: fpga: Cleanup error handling in connection to FPGA_NONE
Incorrect command is already handled and FPGA_NONE should be used only
one. In case of error CMD_RET_USAGE can be returned directly without any
addition logic around.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'cmd/fpga.c')
-rw-r--r-- | cmd/fpga.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/cmd/fpga.c b/cmd/fpga.c index de8505e9d4c..af2f514dca0 100644 --- a/cmd/fpga.c +++ b/cmd/fpga.c @@ -171,11 +171,10 @@ int do_fpga(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) if (dev == FPGA_INVALID_DEVICE) { puts("FPGA device not specified\n"); - op = FPGA_NONE; + return CMD_RET_USAGE; } switch (op) { - case FPGA_NONE: case FPGA_INFO: break; #if defined(CONFIG_CMD_FPGA_LOADFS) @@ -219,13 +218,10 @@ int do_fpga(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) if (wrong_parms) { puts("Wrong parameters for FPGA request\n"); - op = FPGA_NONE; + return CMD_RET_USAGE; } switch (op) { - case FPGA_NONE: - return CMD_RET_USAGE; - case FPGA_INFO: rc = fpga_info(dev); break; |