mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-25 13:14:19 +08:00
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>
This commit is contained in:
parent
65a6b3c2af
commit
550109691e
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user