Standardize command usage messages with cmd_usage()

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
This commit is contained in:
Peter Tyser 2009-01-27 18:03:10 -06:00 committed by Wolfgang Denk
parent 84cde2bb40
commit 62c3ae7c6e
89 changed files with 213 additions and 206 deletions

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}
@ -235,7 +235,7 @@ int do_docboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
offset = simple_strtoul(argv[3], NULL, 16);
break;
default:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
show_boot_progress (-35);
return 1;
}

View file

@ -104,7 +104,7 @@ int do_eeprom ( cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
}
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
#endif

View file

@ -66,7 +66,7 @@ int do_ext2ls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int part_length;
if (argc < 3) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return(1);
}
dev = (int)simple_strtoul (argv[2], &ep, 16);
@ -164,7 +164,7 @@ int do_ext2load (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
break;
default:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return(1);
}

View file

@ -801,7 +801,7 @@ int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
boot_drive=simple_strtoul(argv[2], NULL, 10);
break;
default:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
/* setup FDC and scan for drives */

View file

@ -73,7 +73,7 @@ int do_fdosboot(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
name = argv [2];
break;
default:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
break;
}

View file

@ -66,7 +66,7 @@ void set_working_fdt_addr(void *addr)
int do_fdt (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;
}
@ -125,7 +125,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
int err;
if (argc < 4) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -179,7 +179,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
* Parameters: Node path, new node to be appended to the path.
*/
if (argc < 4) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -217,7 +217,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
* Parameters: Node path, property, optional value.
*/
if (argc < 4) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -427,7 +427,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
}
} else {
/* Unrecognized command */
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
}
@ -441,7 +441,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
unsigned long initrd_start = 0, initrd_end = 0;
if ((argc != 2) && (argc != 4)) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -459,7 +459,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
}
else {
/* Unrecognized command */
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

View file

@ -333,7 +333,7 @@ int do_flerase (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;
}
@ -384,7 +384,7 @@ int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
#endif
if (argc != 3) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -407,7 +407,7 @@ int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
if (addr_first >= addr_last) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -481,7 +481,7 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
#endif
if (argc < 3) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -490,7 +490,7 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
} else if (strcmp(argv[1], "on") == 0) {
p = 1;
} else {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -591,7 +591,7 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
#endif
if (argc != 4) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -633,7 +633,7 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
if (addr_first >= addr_last) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
rcode = flash_sect_protect (p, addr_first, addr_last);

View file

@ -320,7 +320,7 @@ int do_fpga (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
static void fpga_usage (cmd_tbl_t * cmdtp)
{
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
}
/*

View file

@ -159,7 +159,7 @@ int do_i2c_md ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
length = i2c_dp_last_length;
if (argc < 3) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -184,7 +184,7 @@ int do_i2c_md ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
if (argv[2][j] == '.') {
alen = argv[2][j+1] - '0';
if (alen > 4) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
break;
@ -269,7 +269,7 @@ int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int j;
if ((argc < 4) || (argc > 5)) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -287,7 +287,7 @@ int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
if (argv[2][j] == '.') {
alen = argv[2][j+1] - '0';
if (alen > 4) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
break;
@ -355,7 +355,7 @@ int do_i2c_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int j;
if (argc < 4) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -373,7 +373,7 @@ int do_i2c_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
if (argv[2][j] == '.') {
alen = argv[2][j+1] - '0';
if (alen > 4) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
break;
@ -427,7 +427,7 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[])
extern char console_buffer[];
if (argc != 3) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -463,7 +463,7 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[])
if (argv[2][j] == '.') {
alen = argv[2][j+1] - '0';
if (alen > 4) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
break;
@ -601,7 +601,7 @@ int do_i2c_loop(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int j;
if (argc < 3) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -619,7 +619,7 @@ int do_i2c_loop(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
if (argv[2][j] == '.') {
alen = argv[2][j+1] - '0';
if (alen > 4) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
break;
@ -764,7 +764,7 @@ int do_sdram (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;
}
/*
@ -1293,7 +1293,7 @@ int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
return do_sdram(cmdtp, flag, --argc, ++argv);
#endif
else
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 0;
}
#endif /* CONFIG_I2C_CMD_TREE */

View file

@ -188,7 +188,7 @@ int do_ide (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],"res",3) == 0) {
@ -238,7 +238,7 @@ int do_ide (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],"dev",3) == 0) {
@ -287,7 +287,7 @@ int do_ide (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
#endif
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
default:
/* at least 4 args */
@ -347,7 +347,7 @@ int do_ide (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 1;
}
} else {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
rcode = 1;
}
@ -383,7 +383,7 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
boot_device = argv[2];
break;
default:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
show_boot_progress (-42);
return 1;
}

View file

@ -28,7 +28,7 @@ int do_interrupts(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;
}

View file

@ -161,7 +161,7 @@ int do_itest ( 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;
}

View file

@ -2289,7 +2289,7 @@ int do_jffs2_mtdparts(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return delete_partition(argv[2]);
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
#endif /* #ifdef CONFIG_JFFS2_CMDLINE */

View file

@ -1119,7 +1119,7 @@ int do_hwflow (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
if (strcmp(argv[1], "on") == 0)
hwflow_onoff(1);
else
printf("Usage: %s\n", cmdtp->usage);
cmd_usage(cmdtp);
}
printf("RTS/CTS hardware flow control: %s\n", hwflow_onoff(0) ? "on" : "off");
return 0;

View file

@ -241,11 +241,11 @@ int do_log (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:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
}

View file

@ -77,7 +77,7 @@ int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
length = dp_last_length;
if (argc < 2) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -173,7 +173,7 @@ int do_mem_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int size;
if ((argc < 3) || (argc > 4)) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -217,7 +217,7 @@ int do_mem_mdc ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
ulong count;
if (argc < 4) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -246,7 +246,7 @@ int do_mem_mwc ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
ulong count;
if (argc < 4) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -277,7 +277,7 @@ int do_mem_cmp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int rcode = 0;
if (argc != 4) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -361,7 +361,7 @@ int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int size;
if (argc != 4) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -525,7 +525,7 @@ int do_mem_loop (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
volatile u_char *cp;
if (argc < 3) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -596,7 +596,7 @@ int do_mem_loopw (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
volatile u_char *cp;
if (argc < 4) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -1001,7 +1001,7 @@ mod_mem(cmd_tbl_t *cmdtp, int incrflag, 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;
}
@ -1106,7 +1106,7 @@ int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
ulong *ptr;
if (argc < 3) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -1142,7 +1142,7 @@ int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
if (argc < 3) {
usage:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -1202,7 +1202,7 @@ int do_unzip ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
dst = simple_strtoul(argv[2], NULL, 16);
break;
default:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

View file

@ -38,7 +38,7 @@ int do_frd (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
unsigned int blocking;
if (argc < 2) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -46,7 +46,7 @@ int do_frd (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
blocking = (unsigned int)simple_strtoul (argv[2], NULL, 16);
if (fslnum < 0 || fslnum >= XILINX_FSL_NUMBER) {
puts ("Bad number of FSL\n");
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -196,7 +196,7 @@ int do_fwr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
unsigned int blocking;
if (argc < 3) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -204,7 +204,7 @@ int do_fwr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
num = (unsigned int)simple_strtoul (argv[2], NULL, 16);
blocking = (unsigned int)simple_strtoul (argv[3], NULL, 16);
if (fslnum < 0 || fslnum >= XILINX_FSL_NUMBER) {
printf ("Bad number of FSL\nUsage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -354,7 +354,7 @@ int do_rspr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
unsigned int val = 0;
if (argc < 2) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
reg = (unsigned int)simple_strtoul (argv[1], NULL, 16);

View file

@ -302,7 +302,7 @@ int do_mii (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
char *devname;
if (argc < 2) {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -431,7 +431,7 @@ int do_mii (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
else
miiphy_set_current_dev (argv[2]);
} else {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

View file

@ -33,7 +33,7 @@ int do_sleep (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
ulong delay;
if (argc != 2) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

View file

@ -29,7 +29,7 @@ cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
unsigned long cpuid;
if (argc < 3) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -47,7 +47,7 @@ cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
} else if (strncmp(argv[2], "status", 6) == 0) {
cpu_status(cpuid);
} else {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
return 0;
@ -55,12 +55,12 @@ cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
/* 4 or greater, make sure its release */
if (strncmp(argv[2], "release", 7) != 0) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
if (cpu_release(cpuid, argc - 3, argv + 3)) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

View file

@ -463,7 +463,7 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
#endif
usage:
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -638,7 +638,7 @@ int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
usage:
#endif
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
show_boot_progress(-53);
return 1;
}
@ -751,7 +751,7 @@ int do_nand (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) {
@ -789,7 +789,7 @@ int do_nand (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
return 0;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
case 3:
if (strcmp (argv[1], "device") == 0) {
@ -828,7 +828,7 @@ int do_nand (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
return ret;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
default:
/* at least 4 args */
@ -877,7 +877,7 @@ int do_nand (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
}
#endif /* CONFIG_SYS_NAND_SKIP_BAD_DOT_I */
else if (cmdtail) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -913,7 +913,7 @@ int do_nand (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;
}
@ -970,7 +970,7 @@ int do_nandboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
offset = simple_strtoul(argv[3], NULL, 16);
break;
default:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
show_boot_progress (-53);
return 1;
}

View file

@ -186,7 +186,7 @@ netboot_common (proto_t proto, cmd_tbl_t *cmdtp, int argc, char *argv[])
break;
default: printf ("Usage:\n%s\n", cmdtp->usage);
default: cmd_usage(cmdtp);
show_boot_progress (-80);
return 1;
}
@ -251,7 +251,7 @@ int do_ping (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
NetPingIP = string_to_ip(argv[1]);
if (NetPingIP == 0) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return -1;
}

View file

@ -408,7 +408,7 @@ void forceenv (char *varname, char *varvalue)
int do_setenv (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;
}
@ -434,13 +434,13 @@ int do_askenv ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
local_args[3] = NULL;
if (argc < 2) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
/* Check the syntax */
switch (argc) {
case 1:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
case 2: /* askenv envname */

View file

@ -465,7 +465,7 @@ int do_onenand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
return 0;
usage:
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

View file

@ -57,7 +57,7 @@ int do_otp(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
otp_func = otp_write;
else {
usage:
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

View file

@ -534,7 +534,7 @@ int do_pci (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 1;
usage:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

View file

@ -44,7 +44,7 @@ int do_portio_out (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
uint value = out_last_value;
if (argc != 3) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -103,7 +103,7 @@ int do_portio_in (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
uint size = in_last_size;
if (argc != 2) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

View file

@ -57,7 +57,7 @@ int do_reiserls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int part_length;
if (argc < 3) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
dev = (int)simple_strtoul (argv[2], &ep, 16);
@ -150,7 +150,7 @@ int do_reiserload (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
break;
default:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

View file

@ -77,7 +77,7 @@ int do_sata(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],"inf", 3) == 0) {
@ -115,7 +115,7 @@ int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
return rc;
}
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
case 3:
if (strncmp(argv[1], "dev", 3) == 0) {
@ -147,7 +147,7 @@ int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
return rc;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
default: /* at least 4 args */
@ -184,7 +184,7 @@ int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
n, (n == cnt) ? "OK" : "ERROR");
return (n == cnt) ? 0 : 1;
} else {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
rc = 1;
}

View file

@ -229,7 +229,7 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
boot_device = argv[2];
break;
default:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -346,7 +346,7 @@ int do_scsi (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
switch (argc) {
case 0:
case 1: printf ("Usage:\n%s\n", cmdtp->usage); return 1;
case 1: cmd_usage(cmdtp); return 1;
case 2:
if (strncmp(argv[1],"res",3) == 0) {
printf("\nReset SCSI\n");
@ -392,7 +392,7 @@ int do_scsi (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
printf("\nno SCSI devices available\n");
return 1;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
case 3:
if (strncmp(argv[1],"dev",3) == 0) {
@ -421,7 +421,7 @@ int do_scsi (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
return 1;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
default:
/* at least 4 args */
@ -437,7 +437,7 @@ int do_scsi (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 0;
}
} /* switch */
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

View file

@ -35,7 +35,7 @@ int do_setexpr(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
/* Validate arguments */
if ((argc != 5) || (strlen(argv[3]) != 1)) {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

View file

@ -175,7 +175,7 @@ static int do_spi_flash(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return do_spi_flash_erase(argc - 1, argv + 1);
usage:
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

View file

@ -15,7 +15,7 @@ static char *start_addr, *last_addr;
int do_strings(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;
}

View file

@ -441,7 +441,7 @@ static int do_ubi(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
int err = 0;
if (argc < 2) {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -459,7 +459,7 @@ static int do_ubi(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
}
if (argc < 4) {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

View file

@ -366,7 +366,7 @@ int do_usbboot(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
boot_device = argv[2];
break;
default:
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -659,7 +659,7 @@ int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 0;
}
#endif /* CONFIG_USB_STORAGE */
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

View file

@ -50,7 +50,7 @@ int do_vfd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
ulong bitmap;
if (argc != 2) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

View file

@ -379,6 +379,11 @@ cmd_tbl_t *find_cmd (const char *cmd)
return find_cmd_tbl(cmd, &__u_boot_cmd_start, len);
}
void cmd_usage(cmd_tbl_t *cmdtp)
{
printf("Usage:\n%s\n", cmdtp->usage);
}
#ifdef CONFIG_AUTO_COMPLETE
int var_complete(int argc, char *argv[], char last_char, int maxv, char *cmdv[])

View file

@ -1696,7 +1696,7 @@ static int run_pipe_real(struct pipe *pi)
#endif
/* found - check max args */
if ((child->argc - i) > cmdtp->maxargs) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return -1;
}
#endif

View file

@ -1371,7 +1371,7 @@ int run_command (const char *cmd, int flag)
/* found - check max args */
if (argc > cmdtp->maxargs) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
rc = -1;
continue;
}
@ -1415,7 +1415,7 @@ int do_run (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
int i;
if (argc < 2) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

View file

@ -72,7 +72,7 @@ void bedbug603e_do_break (cmd_tbl_t *cmdtp, int flag, int argc,
if (argc < 2)
{
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return;
}
@ -119,7 +119,7 @@ void bedbug603e_do_break (cmd_tbl_t *cmdtp, int flag, int argc,
(( argv[ 1 ][ 0 ] >= 'a' ) && ( argv[ 1 ][ 0 ] <= 'f' )) ||
(( argv[ 1 ][ 0 ] >= 'A' ) && ( argv[ 1 ][ 0 ] <= 'F' ))))
{
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return;
}

View file

@ -119,7 +119,7 @@ int do_ecc(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
writeback[1] = 0x89abcdefUL;
if (argc > 4) {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -350,7 +350,7 @@ int do_ecc(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
return 0;
}
}
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

View file

@ -71,7 +71,7 @@ void bedbug860_do_break (cmd_tbl_t *cmdtp, int flag, int argc,
if (argc < 2)
{
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return;
}
@ -122,7 +122,7 @@ void bedbug860_do_break (cmd_tbl_t *cmdtp, int flag, int argc,
if( !isdigit( argv[ 1 ][ 0 ]))
{
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return;
}

View file

@ -71,7 +71,7 @@ void bedbug405_do_break (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
/* -------------------------------------------------- */
if (argc < 2) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return;
}
@ -125,7 +125,7 @@ void bedbug405_do_break (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
/* Set a breakpoint at the address */
if (!isdigit (argv[1][0])) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return;
}

View file

@ -164,7 +164,7 @@ int do_pca953x(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
if (!c || !((argc == (c->maxargs)) ||
(((int)c->cmd == PCA953X_CMD_DEVICE) &&
(argc == (c->maxargs - 1))))) {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

View file

@ -294,7 +294,7 @@ int do_ds4510(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
if (!c || !((argc == (c->maxargs)) ||
(((int)c->cmd == DS4510_CMD_DEVICE) &&
(argc == (c->maxargs - 1))))) {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -371,7 +371,7 @@ int do_ds4510(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
} else if (strcmp(argv[2], "write") == 0) {
rw_func = ds4510_mem_write;
} else {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

View file

@ -425,7 +425,7 @@ static int qe_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
ulong addr;
if (argc < 3) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -455,7 +455,7 @@ static int qe_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return qe_upload_firmware((const struct qe_firmware *) addr);
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

View file

@ -64,6 +64,8 @@ extern cmd_tbl_t __u_boot_cmd_end;
cmd_tbl_t *find_cmd(const char *cmd);
cmd_tbl_t *find_cmd_tbl (const char *cmd, cmd_tbl_t *table, int table_len);
extern void cmd_usage(cmd_tbl_t *cmdtp);
#ifdef CONFIG_AUTO_COMPLETE
extern void install_auto_complete(void);
extern int cmd_auto_complete(const char *const prompt, char *buf, int *np, int *colp);

View file

@ -122,7 +122,7 @@ int do_flerase(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
int rcode = 0;
if (argc < 2) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -147,7 +147,7 @@ int do_flerase(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
}
if (argc != 3) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -168,7 +168,7 @@ int do_flerase(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
addr_last = simple_strtoul(argv[2], NULL, 16);
if (addr_first >= addr_last) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -244,7 +244,7 @@ int do_protect(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
int rcode = 0;
if (argc < 3) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -253,7 +253,7 @@ int do_protect(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
else if (strcmp(argv[1], "on") == 0)
p = 1;
else {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -310,7 +310,7 @@ int do_protect(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
}
if (argc != 4) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
@ -350,7 +350,7 @@ int do_protect(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
addr_last = simple_strtoul(argv[3], NULL, 16);
if (addr_first >= addr_last) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
rcode = flash_sect_protect (p, addr_first, addr_last);