diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/Kconfig | 2 | ||||
-rw-r--r-- | cmd/exit.c | 7 | ||||
-rw-r--r-- | cmd/fastboot.c | 35 | ||||
-rw-r--r-- | cmd/mvebu/comphy_rx_training.c | 2 |
4 files changed, 24 insertions, 22 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig index 199a55383ee..b2aefae9cb7 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -2539,6 +2539,7 @@ config CMD_MTDPARTS_SHOW_NET_SIZES config MTDIDS_DEFAULT string "Default MTD IDs" depends on MTD || SPI_FLASH + depends on !SYS_MTDPARTS_RUNTIME help Defines a default MTD IDs list for use with MTD partitions in the Linux MTD command line partitions format. @@ -2546,6 +2547,7 @@ config MTDIDS_DEFAULT config MTDPARTS_DEFAULT string "Default MTD partition scheme" depends on MTD || SPI_FLASH + depends on !SYS_MTDPARTS_RUNTIME help Defines a default MTD partitioning scheme in the Linux MTD command line partitions format diff --git a/cmd/exit.c b/cmd/exit.c index 2c7132693ad..7bf241ec732 100644 --- a/cmd/exit.c +++ b/cmd/exit.c @@ -10,10 +10,13 @@ static int do_exit(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { + int r; + + r = 0; if (argc > 1) - return dectoul(argv[1], NULL); + r = simple_strtoul(argv[1], NULL, 10); - return 0; + return -r - 2; } U_BOOT_CMD( diff --git a/cmd/fastboot.c b/cmd/fastboot.c index b498e4b22bb..b94dbd54884 100644 --- a/cmd/fastboot.c +++ b/cmd/fastboot.c @@ -19,8 +19,14 @@ static int do_fastboot_udp(int argc, char *const argv[], uintptr_t buf_addr, size_t buf_size) { -#if CONFIG_IS_ENABLED(UDP_FUNCTION_FASTBOOT) - int err = net_loop(FASTBOOT); + int err; + + if (!CONFIG_IS_ENABLED(UDP_FUNCTION_FASTBOOT)) { + pr_err("Fastboot UDP not enabled\n"); + return CMD_RET_FAILURE; + } + + err = net_loop(FASTBOOT); if (err < 0) { printf("fastboot udp error: %d\n", err); @@ -28,21 +34,21 @@ static int do_fastboot_udp(int argc, char *const argv[], } return CMD_RET_SUCCESS; -#else - pr_err("Fastboot UDP not enabled\n"); - return CMD_RET_FAILURE; -#endif } static int do_fastboot_usb(int argc, char *const argv[], uintptr_t buf_addr, size_t buf_size) { -#if CONFIG_IS_ENABLED(USB_FUNCTION_FASTBOOT) int controller_index; char *usb_controller; char *endp; int ret; + if (!CONFIG_IS_ENABLED(USB_FUNCTION_FASTBOOT)) { + pr_err("Fastboot USB not enabled\n"); + return CMD_RET_FAILURE; + } + if (argc < 2) return CMD_RET_USAGE; @@ -88,10 +94,6 @@ exit: g_dnl_clear_detach(); return ret; -#else - pr_err("Fastboot USB not enabled\n"); - return CMD_RET_FAILURE; -#endif } static int do_fastboot(struct cmd_tbl *cmdtp, int flag, int argc, @@ -148,17 +150,12 @@ NXTARG: return do_fastboot_usb(argc, argv, buf_addr, buf_size); } -#ifdef CONFIG_SYS_LONGHELP -static char fastboot_help_text[] = +U_BOOT_CMD( + fastboot, CONFIG_SYS_MAXARGS, 1, do_fastboot, + "run as a fastboot usb or udp device", "[-l addr] [-s size] usb <controller> | udp\n" "\taddr - address of buffer used during data transfers (" __stringify(CONFIG_FASTBOOT_BUF_ADDR) ")\n" "\tsize - size of buffer used during data transfers (" __stringify(CONFIG_FASTBOOT_BUF_SIZE) ")" - ; -#endif - -U_BOOT_CMD( - fastboot, CONFIG_SYS_MAXARGS, 1, do_fastboot, - "run as a fastboot usb or udp device", fastboot_help_text ); diff --git a/cmd/mvebu/comphy_rx_training.c b/cmd/mvebu/comphy_rx_training.c index 25a9e153de8..4ee8f54ea9c 100644 --- a/cmd/mvebu/comphy_rx_training.c +++ b/cmd/mvebu/comphy_rx_training.c @@ -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); |