Commit 62c3ae7c authored by Peter Tyser's avatar Peter Tyser Committed by Wolfgang Denk

Standardize command usage messages with cmd_usage()

Signed-off-by: default avatarPeter Tyser <ptyser@xes-inc.com>
parent 84cde2bb
......@@ -144,7 +144,7 @@ int do_vcimage (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
rcode = 0;
break;
default:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
rcode = 1;
break;
}
......
......@@ -79,7 +79,7 @@ int ads5121diu_init_show_bmp(cmd_tbl_t *cmdtp,
unsigned int addr;
if (argc < 2) {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -45,7 +45,7 @@ static int do_bootstrap(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int cpu_freq;
if (argc < 3) {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -99,7 +99,7 @@ static int do_bootstrap(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
extern char console_buffer[];
if (argc < 2) {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -43,7 +43,7 @@ static int do_bootstrap(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
char pcixClock[4];
if (argc < 3) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -183,7 +183,7 @@ do_pll_alter (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
char c = '\0';
pll_freq_t pll_freq;
if (argc < 2) {
printf("Usage: \n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
goto ret;
}
......@@ -222,8 +222,8 @@ do_pll_alter (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
goto ret;
default:
printf("Invalid options"
"\n\nUsage: \n%s\n", cmdtp->usage);
printf("Invalid options\n\n");
cmd_usage(cmdtp);
goto ret;
}
......
......@@ -319,7 +319,7 @@ int do_l2cache( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] )
l2cache_status() ? "ON" : "OFF");
return 0;
default:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -183,7 +183,7 @@ do_pll_alter (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
char c = '\0';
pll_freq_t pll_freq;
if (argc < 2) {
printf("Usage: \n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
goto ret;
}
......@@ -222,8 +222,8 @@ do_pll_alter (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
goto ret;
default:
printf("Invalid options"
"\n\nUsage: \n%s\n", cmdtp->usage);
printf("Invalid options\n\n");
cmd_usage(cmdtp);
goto ret;
}
......
......@@ -128,7 +128,7 @@ static int do_bootstrap(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
extern char console_buffer[];
if (argc < 2) {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -59,7 +59,7 @@ static int setBootStrapClock(cmd_tbl_t *cmdtp, int incrflag, int flag,
char pcixClock[4];
if (argc < 3) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -292,7 +292,7 @@ int barcobcd_boot_image (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
#if 0
if (argc > 1) {
printf ("Usage:\n (%d) %s\n", argc, cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
#endif
......
......@@ -346,7 +346,7 @@ int do_esdbmp(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
char *str;
#endif
if (argc != 2) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -220,7 +220,7 @@ int do_pci9054 (cmd_tbl_t * cmdtp, int flag, int argc,
return 0;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -328,7 +328,7 @@ int do_mac(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
prog_eeprom();
break;
default:
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
break;
}
......@@ -362,7 +362,7 @@ int do_mac(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
break;
case 'h': /* help */
default:
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
break;
}
......
......@@ -116,7 +116,7 @@ int mpc8610diu_init_show_bmp(cmd_tbl_t *cmdtp,
unsigned int addr;
if (argc < 2) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -272,7 +272,7 @@ do_fpga (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
break;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
U_BOOT_CMD(
......@@ -324,7 +324,7 @@ do_eecl (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
/* fall through ... */
default:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -846,7 +846,7 @@ int do_pic (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
default:
break;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
U_BOOT_CMD(
......@@ -976,7 +976,7 @@ int do_lsb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
default:
break;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -467,7 +467,7 @@ void hw_watchdog_reset(void)
int do_eeprom_wp(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
if (argc < 2) {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......@@ -476,7 +476,7 @@ int do_eeprom_wp(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
} else if ((strcmp(argv[1], "off") == 0)) {
gpio_write_bit(CONFIG_SYS_GPIO_EEPROM_EXT_WP, 0);
} else {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -559,7 +559,7 @@ int do_mplcommon(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 0;
}
#endif
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -230,7 +230,7 @@ int do_wd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
default:
break;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -780,7 +780,7 @@ int do_sha1 (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
if (argc < 2) {
usage:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -41,7 +41,7 @@ int do_led (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
unsigned int number, function;
if (argc != 3) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
number = simple_strtoul(argv[1], NULL, 10);
......@@ -83,7 +83,7 @@ int do_loadpci (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
addr = simple_strtoul(argv[1], NULL, 16);
break;
default:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -216,7 +216,7 @@ int do_fpga(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
ulong addr;
if (argc < 2) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -305,7 +305,7 @@ int do_set_mac(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
char *s, *e;
if (argc != 2) {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......@@ -331,7 +331,7 @@ U_BOOT_CMD(
int do_print_mac(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
if (argc != 1) {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -113,7 +113,7 @@ int do_hw_test(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
char *cmd;
if (argc != 2) {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......@@ -150,7 +150,7 @@ int do_hw_test(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
test_net();
break;
default:
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -286,7 +286,7 @@ int do_fpga (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 0;
failure:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -399,7 +399,7 @@ int do_puma (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
default:
break;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -133,7 +133,7 @@ int do_sled (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
default:
break;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -145,7 +145,7 @@ int do_wd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
default:
break;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -327,7 +327,7 @@ static int cmd_sound(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
switch (argc) {
case 0:
case 1:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
case 2:
if (strncmp(argv[1],"saw",3) == 0) {
......@@ -342,7 +342,7 @@ static int cmd_sound(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return rcode;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
case 3:
if (strncmp(argv[1],"saw",3) == 0) {
......@@ -358,7 +358,7 @@ static int cmd_sound(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
LEFT_RIGHT);
return rcode;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
case 4:
if (strncmp(argv[1],"saw",3) == 0) {
......@@ -382,7 +382,7 @@ static int cmd_sound(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
pcm1772_write_reg((uchar)reg, (uchar)val);
return 0;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
case 5:
if (strncmp(argv[1],"saw",3) == 0) {
......@@ -412,7 +412,7 @@ static int cmd_sound(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
channel);
return rcode;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
printf ("Usage:\nsound cmd [arg1] [arg2] ...\n");
......@@ -513,7 +513,7 @@ static int cmd_beep(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
channel = LEFT_RIGHT;
break;
default:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -168,7 +168,7 @@ int do_burn_in (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int cycle_status;
if (argc > 1) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......@@ -271,7 +271,7 @@ int do_dip (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int i, dip;
if (argc > 1) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......@@ -304,7 +304,7 @@ int do_vcc5v (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int vcc5v;
if (argc > 1) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......@@ -332,7 +332,7 @@ int do_contact_temp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int contact_temp;
if (argc > 1) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......@@ -355,7 +355,7 @@ U_BOOT_CMD(
int do_burn_in_status (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
if (argc > 1) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......@@ -851,7 +851,7 @@ int do_temp_log (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
#endif
if (argc > 2) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -43,7 +43,7 @@ static int do_write_dm9000_eeprom ( cmd_tbl_t *cmdtp, int flag, int argc, char *
int offset,value;
if (argc < 4) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......@@ -51,7 +51,7 @@ static int do_write_dm9000_eeprom ( cmd_tbl_t *cmdtp, int flag, int argc, char *
value=simple_strtoul(argv[3],NULL,16);
if (offset > 0x40) {
printf("Wrong offset : 0x%x\n",offset);
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
write_srom_word(offset, value);
......@@ -60,7 +60,7 @@ static int do_write_dm9000_eeprom ( cmd_tbl_t *cmdtp, int flag, int argc, char *
int do_dm9000_eeprom ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) {
if (argc < 2) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......@@ -69,7 +69,7 @@ int do_dm9000_eeprom ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) {
} else if (strcmp (argv[1],"write") == 0) {
return (do_write_dm9000_eeprom(cmdtp,flag,argc,argv));
} else {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
}
......
......@@ -39,7 +39,7 @@ int do_vpd (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
/* Validate usage */
if (argc > 2) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -85,7 +85,7 @@ int do_bedbug_dis (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
len = dis_last_len;
if (argc < 2) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......@@ -126,7 +126,7 @@ int do_bedbug_asm (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
int rcode = 0;
if (argc < 2) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -120,7 +120,7 @@ int do_bmp(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
y = simple_strtoul(argv[4], NULL, 10);
break;
default:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......@@ -132,7 +132,7 @@ int do_bmp(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
} else if (strncmp(argv[1],"display",1) == 0) {
return (bmp_display(addr, x, y));
} else {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
}
......
......@@ -41,7 +41,7 @@ int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int rcode = 0;
if (argc < 2) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -454,13 +454,13 @@ int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
/* Unrecognized command */
else {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
if (images.state >= state) {
printf ("Trying to execute a command out of order\n");
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -37,7 +37,7 @@ int do_icache ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
case 2: /* on / off */
switch (on_off(argv[1])) {
#if 0 /* prevented by varargs handling; FALLTROUGH is harmless, too */
default: printf ("Usage:\n%s\n", cmdtp->usage);
default: cmd_usage(cmdtp);
return;
#endif
case 0: icache_disable();
......@@ -51,7 +51,7 @@ int do_icache ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
icache_status() ? "ON" : "OFF");
return 0;
default:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
return 0;
......@@ -63,7 +63,7 @@ int do_dcache ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
case 2: /* on / off */
switch (on_off(argv[1])) {
#if 0 /* prevented by varargs handling; FALLTROUGH is harmless, too */
default: printf ("Usage:\n%s\n", cmdtp->usage);
default: cmd_usage(cmdtp);
return;
#endif
case 0: dcache_disable();
......@@ -77,7 +77,7 @@ int do_dcache ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
dcache_status() ? "ON" : "OFF");
return 0;
default:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
return 0;
......
......@@ -89,7 +89,7 @@ int do_date (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
break;
default:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
rcode = 1;
}
......
......@@ -45,7 +45,7 @@ int do_getdcr ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] )
/* Validate arguments */
if (argc < 2) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......@@ -74,7 +74,7 @@ int do_setdcr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
/* Validate arguments */
if (argc < 2) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......@@ -121,7 +121,7 @@ int do_getidcr (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
/* Validate arguments */
if (argc < 3) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......@@ -177,7 +177,7 @@ int do_setidcr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
/* Validate arguments */
if (argc < 4) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -27,7 +27,7 @@ static int do_df(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
usage:
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
......
......@@ -96,7 +96,7 @@ int do_doc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
switch (argc) {
case 0:
case 1:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
case 2:
if (strcmp(argv[1],"info") == 0) {
......@@ -121,7 +121,7 @@ int do_doc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
doc_print(&doc_dev_desc[curr_device]);
return 0;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
case 3:
if (strcmp(argv[1],"device") == 0) {
......@@ -146,7 +146,7 @@ int do_doc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 0;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
default:
/* at least 4 args */
......@@ -182,7 +182,7 @@ int do_doc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return ret;
} else {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
rcode = 1;