summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/BuS/EB+MCF-EV123/EB+MCF-EV123.c2
-rw-r--r--board/ads5121/ads5121_diu.c2
-rw-r--r--board/amcc/acadia/cmd_acadia.c2
-rw-r--r--board/amcc/canyonlands/bootstrap.c2
-rw-r--r--board/amcc/katmai/cmd_katmai.c2
-rw-r--r--board/amcc/kilauea/cmd_pll.c6
-rw-r--r--board/amcc/luan/luan.c2
-rw-r--r--board/amcc/makalu/cmd_pll.c6
-rw-r--r--board/amcc/sequoia/cmd_sequoia.c2
-rw-r--r--board/amcc/yucca/cmd_yucca.c2
-rw-r--r--board/barco/barco.c2
-rw-r--r--board/esd/common/lcd.c2
-rw-r--r--board/esd/dasa_sim/cmd_dasa_sim.c2
-rw-r--r--board/freescale/common/sys_eeprom.c4
-rw-r--r--board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c2
-rw-r--r--board/hymod/bsp.c4
-rw-r--r--board/lwmon/lwmon.c4
-rw-r--r--board/lwmon5/lwmon5.c4
-rw-r--r--board/mpl/common/common_util.c2
-rw-r--r--board/pcippc2/pcippc2.c2
-rw-r--r--board/pcs440ep/pcs440ep.c2
-rw-r--r--board/pn62/cmd_pn62.c4
-rw-r--r--board/prodrive/pdnb3/pdnb3.c2
-rw-r--r--board/renesas/sh7785lcr/rtl8169_mac.c4
-rw-r--r--board/renesas/sh7785lcr/selfcheck.c4
-rw-r--r--board/siemens/common/fpga.c2
-rw-r--r--board/siemens/pcu_e/pcu_e.c2
-rw-r--r--board/ssv/common/cmd_sled.c2
-rw-r--r--board/ssv/common/wd_pio.c2
-rw-r--r--board/tqc/tqm5200/cmd_stk52xx.c12
-rw-r--r--board/trab/cmd_trab.c12
-rw-r--r--board/trizepsiv/eeprom.c8
-rw-r--r--board/w7o/cmd_vpd.c2
-rw-r--r--common/cmd_bedbug.c4
-rw-r--r--common/cmd_bmp.c4
-rw-r--r--common/cmd_boot.c2
-rw-r--r--common/cmd_bootm.c4
-rw-r--r--common/cmd_cache.c8
-rw-r--r--common/cmd_date.c2
-rw-r--r--common/cmd_dcr.c8
-rw-r--r--common/cmd_df.c2
-rw-r--r--common/cmd_doc.c10
-rw-r--r--common/cmd_eeprom.c2
-rw-r--r--common/cmd_ext2.c4
-rw-r--r--common/cmd_fdc.c2
-rw-r--r--common/cmd_fdos.c2
-rw-r--r--common/cmd_fdt.c14
-rw-r--r--common/cmd_flash.c14
-rw-r--r--common/cmd_fpga.c2
-rw-r--r--common/cmd_i2c.c24
-rw-r--r--common/cmd_ide.c10
-rw-r--r--common/cmd_irq.c2
-rw-r--r--common/cmd_itest.c2
-rw-r--r--common/cmd_jffs2.c2
-rw-r--r--common/cmd_load.c2
-rw-r--r--common/cmd_log.c4
-rw-r--r--common/cmd_mem.c24
-rw-r--r--common/cmd_mfsl.c10
-rw-r--r--common/cmd_mii.c4
-rw-r--r--common/cmd_misc.c2
-rw-r--r--common/cmd_mp.c8
-rw-r--r--common/cmd_nand.c16
-rw-r--r--common/cmd_net.c4
-rw-r--r--common/cmd_nvedit.c6
-rw-r--r--common/cmd_onenand.c2
-rw-r--r--common/cmd_otp.c2
-rw-r--r--common/cmd_pci.c2
-rw-r--r--common/cmd_portio.c4
-rw-r--r--common/cmd_reiser.c4
-rw-r--r--common/cmd_sata.c8
-rw-r--r--common/cmd_scsi.c10
-rw-r--r--common/cmd_setexpr.c2
-rw-r--r--common/cmd_sf.c2
-rw-r--r--common/cmd_strings.c2
-rw-r--r--common/cmd_ubi.c4
-rw-r--r--common/cmd_usb.c4
-rw-r--r--common/cmd_vfd.c2
-rw-r--r--common/command.c5
-rw-r--r--common/hush.c2
-rw-r--r--common/main.c4
-rw-r--r--cpu/mpc8260/bedbug_603e.c4
-rw-r--r--cpu/mpc83xx/ecc.c4
-rw-r--r--cpu/mpc8xx/bedbug_860.c4
-rw-r--r--cpu/ppc4xx/bedbug_405.c4
-rw-r--r--drivers/gpio/pca953x.c2
-rw-r--r--drivers/misc/ds4510.c4
-rw-r--r--drivers/qe/qe.c4
-rw-r--r--include/command.h2
-rw-r--r--tools/updater/cmd_flash.c14
89 files changed, 213 insertions, 206 deletions
diff --git a/board/BuS/EB+MCF-EV123/EB+MCF-EV123.c b/board/BuS/EB+MCF-EV123/EB+MCF-EV123.c
index d509a8fdbc3..753d85b1b20 100644
--- a/board/BuS/EB+MCF-EV123/EB+MCF-EV123.c
+++ b/board/BuS/EB+MCF-EV123/EB+MCF-EV123.c
@@ -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;
}
diff --git a/board/ads5121/ads5121_diu.c b/board/ads5121/ads5121_diu.c
index 896900b2ee5..11e2be781f4 100644
--- a/board/ads5121/ads5121_diu.c
+++ b/board/ads5121/ads5121_diu.c
@@ -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;
}
diff --git a/board/amcc/acadia/cmd_acadia.c b/board/amcc/acadia/cmd_acadia.c
index 052cf6184a9..9fc03f106cb 100644
--- a/board/amcc/acadia/cmd_acadia.c
+++ b/board/amcc/acadia/cmd_acadia.c
@@ -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;
}
diff --git a/board/amcc/canyonlands/bootstrap.c b/board/amcc/canyonlands/bootstrap.c
index b1f4a213d97..35284d17942 100644
--- a/board/amcc/canyonlands/bootstrap.c
+++ b/board/amcc/canyonlands/bootstrap.c
@@ -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;
}
diff --git a/board/amcc/katmai/cmd_katmai.c b/board/amcc/katmai/cmd_katmai.c
index ba71bd55c08..d3626556639 100644
--- a/board/amcc/katmai/cmd_katmai.c
+++ b/board/amcc/katmai/cmd_katmai.c
@@ -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;
}
diff --git a/board/amcc/kilauea/cmd_pll.c b/board/amcc/kilauea/cmd_pll.c
index 0f571fefed7..3b49e5b37ad 100644
--- a/board/amcc/kilauea/cmd_pll.c
+++ b/board/amcc/kilauea/cmd_pll.c
@@ -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;
}
diff --git a/board/amcc/luan/luan.c b/board/amcc/luan/luan.c
index de3e3d8b925..e1357f404b1 100644
--- a/board/amcc/luan/luan.c
+++ b/board/amcc/luan/luan.c
@@ -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;
}
diff --git a/board/amcc/makalu/cmd_pll.c b/board/amcc/makalu/cmd_pll.c
index 0f571fefed7..3b49e5b37ad 100644
--- a/board/amcc/makalu/cmd_pll.c
+++ b/board/amcc/makalu/cmd_pll.c
@@ -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;
}
diff --git a/board/amcc/sequoia/cmd_sequoia.c b/board/amcc/sequoia/cmd_sequoia.c
index 3402f84a3e6..c840748d43d 100644
--- a/board/amcc/sequoia/cmd_sequoia.c
+++ b/board/amcc/sequoia/cmd_sequoia.c
@@ -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;
}
diff --git a/board/amcc/yucca/cmd_yucca.c b/board/amcc/yucca/cmd_yucca.c
index d9698602b1a..5198317dd25 100644
--- a/board/amcc/yucca/cmd_yucca.c
+++ b/board/amcc/yucca/cmd_yucca.c
@@ -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;
}
diff --git a/board/barco/barco.c b/board/barco/barco.c
index ed355721950..e3abca4cffd 100644
--- a/board/barco/barco.c
+++ b/board/barco/barco.c
@@ -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
diff --git a/board/esd/common/lcd.c b/board/esd/common/lcd.c
index 1eea59ecb12..1db8d9058a9 100644
--- a/board/esd/common/lcd.c
+++ b/board/esd/common/lcd.c
@@ -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;
}
diff --git a/board/esd/dasa_sim/cmd_dasa_sim.c b/board/esd/dasa_sim/cmd_dasa_sim.c
index 36dd58c3e4b..97a39c9d7a5 100644
--- a/board/esd/dasa_sim/cmd_dasa_sim.c
+++ b/board/esd/dasa_sim/cmd_dasa_sim.c
@@ -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;
}
diff --git a/board/freescale/common/sys_eeprom.c b/board/freescale/common/sys_eeprom.c
index eb58c7fd57c..988cb94aa13 100644
--- a/board/freescale/common/sys_eeprom.c
+++ b/board/freescale/common/sys_eeprom.c
@@ -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;
}
diff --git a/board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c b/board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c
index 08eaf10dd3d..2320c0f1387 100644
--- a/board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c
+++ b/board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c
@@ -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;
}
diff --git a/board/hymod/bsp.c b/board/hymod/bsp.c
index 1848bb3fcaa..54b3b86c6db 100644
--- a/board/hymod/bsp.c
+++ b/board/hymod/bsp.c
@@ -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;
}
diff --git a/board/lwmon/lwmon.c b/board/lwmon/lwmon.c
index 878752c6691..257f1cd2497 100644
--- a/board/lwmon/lwmon.c
+++ b/board/lwmon/lwmon.c
@@ -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;
}
diff --git a/board/lwmon5/lwmon5.c b/board/lwmon5/lwmon5.c
index aa62f37900a..adecad0f8d8 100644
--- a/board/lwmon5/lwmon5.c
+++ b/board/lwmon5/lwmon5.c
@@ -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;
}
diff --git a/board/mpl/common/common_util.c b/board/mpl/common/common_util.c
index 877a2d0044f..d16939120ae 100644
--- a/board/mpl/common/common_util.c
+++ b/board/mpl/common/common_util.c
@@ -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;
}
diff --git a/board/pcippc2/pcippc2.c b/board/pcippc2/pcippc2.c
index a3dbdc846e0..c706ca588d7 100644
--- a/board/pcippc2/pcippc2.c
+++ b/board/pcippc2/pcippc2.c
@@ -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;
}
diff --git a/board/pcs440ep/pcs440ep.c b/board/pcs440ep/pcs440ep.c
index 73a7a08e278..01ceecebbb8 100644
--- a/board/pcs440ep/pcs440ep.c
+++ b/board/pcs440ep/pcs440ep.c
@@ -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;
}
diff --git a/board/pn62/cmd_pn62.c b/board/pn62/cmd_pn62.c
index 3f53e4b7cad..bb98fcfa00c 100644
--- a/board/pn62/cmd_pn62.c
+++ b/board/pn62/cmd_pn62.c
@@ -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;
}
diff --git a/board/prodrive/pdnb3/pdnb3.c b/board/prodrive/pdnb3/pdnb3.c
index 3773ba18184..9b87f6a8a95 100644
--- a/board/prodrive/pdnb3/pdnb3.c
+++ b/board/prodrive/pdnb3/pdnb3.c
@@ -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;
}
diff --git a/board/renesas/sh7785lcr/rtl8169_mac.c b/board/renesas/sh7785lcr/rtl8169_mac.c
index bf0ba145d20..8b04453adb2 100644
--- a/board/renesas/sh7785lcr/rtl8169_mac.c
+++ b/board/renesas/sh7785lcr/rtl8169_mac.c
@@ -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;
}
diff --git a/board/renesas/sh7785lcr/selfcheck.c b/board/renesas/sh7785lcr/selfcheck.c
index ce0620f6878..22079fbcc0d 100644
--- a/board/renesas/sh7785lcr/selfcheck.c
+++ b/board/renesas/sh7785lcr/selfcheck.c
@@ -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;
}
diff --git a/board/siemens/common/fpga.c b/board/siemens/common/fpga.c
index ac0022e7b13..63aa179d2db 100644
--- a/board/siemens/common/fpga.c
+++ b/board/siemens/common/fpga.c
@@ -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;
}
diff --git a/board/siemens/pcu_e/pcu_e.c b/board/siemens/pcu_e/pcu_e.c
index a60c825b2b5..25cf2bb2971 100644
--- a/board/siemens/pcu_e/pcu_e.c
+++ b/board/siemens/pcu_e/pcu_e.c
@@ -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;
}
diff --git a/board/ssv/common/cmd_sled.c b/board/ssv/common/cmd_sled.c
index 2208580faec..cb796982b9f 100644
--- a/board/ssv/common/cmd_sled.c
+++ b/board/ssv/common/cmd_sled.c
@@ -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;
}
diff --git a/board/ssv/common/wd_pio.c b/board/ssv/common/wd_pio.c
index 9945c5987e1..8823ed12f43 100644
--- a/board/ssv/common/wd_pio.c
+++ b/board/ssv/common/wd_pio.c
@@ -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;
}
diff --git a/board/tqc/tqm5200/cmd_stk52xx.c b/board/tqc/tqm5200/cmd_stk52xx.c
index 5483fcaf7a3..6ef7fbe0132 100644
--- a/board/tqc/tqm5200/cmd_stk52xx.c
+++ b/board/tqc/tqm5200/cmd_stk52xx.c
@@ -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;
}
diff --git a/board/trab/cmd_trab.c b/board/trab/cmd_trab.c
index daa6aeefc73..5020d609f45 100644
--- a/board/trab/cmd_trab.c
+++ b/board/trab/cmd_trab.c
@@ -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;
}
diff --git a/board/trizepsiv/eeprom.c b/board/trizepsiv/eeprom.c
index 7a2b90585b8..e11519aa2f8 100644
--- a/board/trizepsiv/eeprom.c
+++ b/board/trizepsiv/eeprom.c
@@ -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;
}
}
diff --git a/board/w7o/cmd_vpd.c b/board/w7o/cmd_vpd.c
index 310fde052f9..52025213d7f 100644
--- a/board/w7o/cmd_vpd.c
+++ b/board/w7o/cmd_vpd.c
@@ -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;
}
diff --git a/common/cmd_bedbug.c b/common/cmd_bedbug.c
index e6277c94086..1dda1933447 100644
--- a/common/cmd_bedbug.c
+++ b/common/cmd_bedbug.c
@@ -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;
}
diff --git a/common/cmd_bmp.c b/common/cmd_bmp.c
index bc08b2655a9..e60f18b15b5 100644
--- a/common/cmd_bmp.c
+++ b/common/cmd_bmp.c
@@ -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;
}
}
diff --git a/common/cmd_boot.c b/common/cmd_boot.c
index 6024ffeb42b..36106c7e606 100644
--- a/common/cmd_boot.c
+++ b/common/cmd_boot.c
@@ -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;
}
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 905567293cd..68f167594cc 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -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;
}
diff --git a/common/cmd_cache.c b/common/cmd_cache.c
index 675d43fa187..caa56daf2ed 100644
--- a/common/cmd_cache.c
+++ b/common/cmd_cache.c
@@ -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;
diff --git a/common/cmd_date.c b/common/cmd_date.c
index b4d9649bdde..d6bd931caff 100644
--- a/common/cmd_date.c
+++ b/common/cmd_date.c
@@ -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;
}
diff --git a/common/cmd_dcr.c b/common/cmd_dcr.c
index 439d07a65dd..7d382bbbf24 100644
--- a/common/cmd_dcr.c
+++ b/common/cmd_dcr.c
@@ -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;
}
diff --git a/common/cmd_df.c b/common/cmd_df.c
index 5f650442c01..c85b7a62417 100644
--- a/common/cmd_df.c
+++ b/common/cmd_df.c
@@ -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;
}
diff --git a/common/cmd_doc.c b/common/cmd_doc.c
index 02502cc810c..f139d42cbaf 100644
--- a/common/cmd_doc.c
+++ b/common/cmd_doc.c
@@ -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;
}
diff --git a/common/cmd_eeprom.c b/common/cmd_eeprom.c
index 2451bef74f4..c59227d6049 100644
--- a/common/cmd_eeprom.c
+++ b/common/cmd_eeprom.c
@@ -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
diff --git a/common/cmd_ext2.c b/common/cmd_ext2.c
index 9c43792f328..05a053b45bd 100644
--- a/common/cmd_ext2.c
+++ b/common/cmd_ext2.c
@@ -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);
}
diff --git a/common/cmd_fdc.c b/common/cmd_fdc.c
index d995ff21ef9..c6265c38c69 100644
--- a/common/cmd_fdc.c
+++ b/common/cmd_fdc.c
@@ -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 */
diff --git a/common/cmd_fdos.c b/common/cmd_fdos.c
index aa13b526165..514c049b8b5 100644
--- a/common/cmd_fdos.c
+++ b/common/cmd_fdos.c
@@ -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;
}
diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c
index 4274a773a7a..a36ca20d5b4 100644
--- a/common/cmd_fdt.c
+++ b/common/cmd_fdt.c
@@ -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;
}
diff --git a/common/cmd_flash.c b/common/cmd_flash.c
index 93eefa96432..2df40f0ee54 100644
--- a/common/cmd_flash.c
+++ b/common/cmd_flash.c
@@ -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);
diff --git a/common/cmd_fpga.c b/common/cmd_fpga.c
index dcbbc993dd2..4abb86e9146 100644
--- a/common/cmd_fpga.c
+++ b/common/cmd_fpga.c
@@ -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);
}
/*
diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index 448f2fedd7f..170ebc7251a 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -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 */
diff --git a/common/cmd_ide.c b/common/cmd_ide.c
index db05f76e5c5..3afa38d9ce4 100644
--- a/common/cmd_ide.c
+++ b/common/cmd_ide.c
@@ -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;
}
diff --git a/common/cmd_irq.c b/common/cmd_irq.c
index 04914c62116..a47cde4245c 100644
--- a/common/cmd_irq.c
+++ b/common/cmd_irq.c
@@ -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;
}
diff --git a/common/cmd_itest.c b/common/cmd_itest.c
index 9e77fa91319..b3025e37eba 100644
--- a/common/cmd_itest.c
+++ b/common/cmd_itest.c
@@ -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;
}
diff --git a/common/cmd_jffs2.c b/common/cmd_jffs2.c
index 0818ea811b2..4c63f51c104 100644
--- a/common/cmd_jffs2.c
+++ b/common/cmd_jffs2.c
@@ -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 */
diff --git a/common/cmd_load.c b/common/cmd_load.c
index 65a4d692a9f..350d7a3524a 100644
--- a/common/cmd_load.c
+++ b/common/cmd_load.c
@@ -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;
diff --git a/common/cmd_log.c b/common/cmd_log.c
index febdb90cfcb..6f8a27fe445 100644
--- a/common/cmd_log.c
+++ b/common/cmd_log.c
@@ -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;
}
}
diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index c209d62d8eb..e2af0306383 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -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;
}
diff --git a/common/cmd_mfsl.c b/common/cmd_mfsl.c
index c2442eed136..db2a994ce41 100644
--- a/common/cmd_mfsl.c
+++ b/common/cmd_mfsl.c
@@ -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);
diff --git a/common/cmd_mii.c b/common/cmd_mii.c
index bcbd7aa4ee3..19a7fbd6884 100644
--- a/common/cmd_mii.c
+++ b/common/cmd_mii.c
@@ -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;
}
diff --git a/common/cmd_misc.c b/common/cmd_misc.c
index 3ea8ee07f76..c29f52baecf 100644
--- a/common/cmd_misc.c
+++ b/common/cmd_misc.c
@@ -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;
}
diff --git a/common/cmd_mp.c b/common/cmd_mp.c
index f3a7f49e10f..d8e3ab2b247 100644
--- a/common/cmd_mp.c
+++ b/common/cmd_mp.c
@@ -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;
}
diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index aedf8a624e7..55d54669c2a 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -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;
}
diff --git a/common/cmd_net.c b/common/cmd_net.c
index c053d7b97a7..b627c3851a9 100644
--- a/common/cmd_net.c
+++ b/common/cmd_net.c
@@ -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;
}
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index b93de13d086..af404176aa2 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -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 */
diff --git a/common/cmd_onenand.c b/common/cmd_onenand.c
index 6a2c924929b..6d43a779440 100644
--- a/common/cmd_onenand.c
+++ b/common/cmd_onenand.c
@@ -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;
}
diff --git a/common/cmd_otp.c b/common/cmd_otp.c
index 825fa34cebb..bdf2e6a8be6 100644
--- a/common/cmd_otp.c
+++ b/common/cmd_otp.c
@@ -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;
}
diff --git a/common/cmd_pci.c b/common/cmd_pci.c
index 67ff2fbc3b4..110415e7dcc 100644
--- a/common/cmd_pci.c
+++ b/common/cmd_pci.c
@@ -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;
}
diff --git a/common/cmd_portio.c b/common/cmd_portio.c
index c88fcd5e451..b318ff09248 100644
--- a/common/cmd_portio.c
+++ b/common/cmd_portio.c
@@ -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;
}
diff --git a/common/cmd_reiser.c b/common/cmd_reiser.c
index 4f4117ec709..a2f22866b65 100644
--- a/common/cmd_reiser.c
+++ b/common/cmd_reiser.c
@@ -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;
}
diff --git a/common/cmd_sata.c b/common/cmd_sata.c
index c6e0d3760ad..3380768bbe7 100644
--- a/common/cmd_sata.c
+++ b/common/cmd_sata.c
@@ -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;
}
diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c
index 066fd804a84..8aae9fcac30 100644
--- a/common/cmd_scsi.c
+++ b/common/cmd_scsi.c
@@ -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;
}
diff --git a/common/cmd_setexpr.c b/common/cmd_setexpr.c
index 2e49b6dd928..4125b183db1 100644
--- a/common/cmd_setexpr.c
+++ b/common/cmd_setexpr.c
@@ -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;
}
diff --git a/common/cmd_sf.c b/common/cmd_sf.c
index 8c0a7514dfa..6dc522d7a27 100644
--- a/common/cmd_sf.c
+++ b/common/cmd_sf.c
@@ -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;
}
diff --git a/common/cmd_strings.c b/common/cmd_strings.c
index 7d05cf8e938..6f0cbca1a02 100644
--- a/common/cmd_strings.c
+++ b/common/cmd_strings.c
@@ -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;
}
diff --git a/common/cmd_ubi.c b/common/cmd_ubi.c
index 5c31f7b49f0..305e2e17aea 100644
--- a/common/cmd_ubi.c
+++ b/common/cmd_ubi.c
@@ -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;
}
diff --git a/common/cmd_usb.c b/common/cmd_usb.c
index 8b19240a840..46d6eea572f 100644
--- a/common/cmd_usb.c
+++ b/common/cmd_usb.c
@@ -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;
}
diff --git a/common/cmd_vfd.c b/common/cmd_vfd.c
index 45f427126da..ef4dd835b52 100644
--- a/common/cmd_vfd.c
+++ b/common/cmd_vfd.c
@@ -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;
}
diff --git a/common/command.c b/common/command.c
index a4a978c5fdc..c3966484f9a 100644
--- a/common/command.c
+++ b/common/command.c
@@ -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[])
diff --git a/common/hush.c b/common/hush.c
index 9aef6e41dbf..dbb4035613d 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -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
diff --git a/common/main.c b/common/main.c
index 4c4f7806500..905d40f0e09 100644
--- a/common/main.c
+++ b/common/main.c
@@ -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;
}
diff --git a/cpu/mpc8260/bedbug_603e.c b/cpu/mpc8260/bedbug_603e.c
index f1be485e8eb..c969ff65e6f 100644
--- a/cpu/mpc8260/bedbug_603e.c
+++ b/cpu/mpc8260/bedbug_603e.c
@@ -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;
}
diff --git a/cpu/mpc83xx/ecc.c b/cpu/mpc83xx/ecc.c
index 5ab169fe3e0..47c8937aa6c 100644
--- a/cpu/mpc83xx/ecc.c
+++ b/cpu/mpc83xx/ecc.c
@@ -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;
}
diff --git a/cpu/mpc8xx/bedbug_860.c b/cpu/mpc8xx/bedbug_860.c
index 5d523663924..0308bbbf7a8 100644
--- a/cpu/mpc8xx/bedbug_860.c
+++ b/cpu/mpc8xx/bedbug_860.c
@@ -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;
}
diff --git a/cpu/ppc4xx/bedbug_405.c b/cpu/ppc4xx/bedbug_405.c
index 5ef5607918d..ef11cb65e41 100644
--- a/cpu/ppc4xx/bedbug_405.c
+++ b/cpu/ppc4xx/bedbug_405.c
@@ -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;
}
diff --git a/drivers/gpio/pca953x.c b/drivers/gpio/pca953x.c
index 390d99ad3d6..f80baeb1fa6 100644
--- a/drivers/gpio/pca953x.c
+++ b/drivers/gpio/pca953x.c
@@ -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;
}
diff --git a/drivers/misc/ds4510.c b/drivers/misc/ds4510.c
index 4cd2fc22498..958ff684541 100644
--- a/drivers/misc/ds4510.c
+++ b/drivers/misc/ds4510.c
@@ -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;
}
diff --git a/drivers/qe/qe.c b/drivers/qe/qe.c
index e914d01d805..7b29fd71601 100644
--- a/drivers/qe/qe.c
+++ b/drivers/qe/qe.c
@@ -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;
}
diff --git a/include/command.h b/include/command.h
index a8a153cb0fc..58992e9796f 100644
--- a/include/command.h
+++ b/include/command.h
@@ -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);
diff --git a/tools/updater/cmd_flash.c b/tools/updater/cmd_flash.c
index 5ff7336599b..5ce45baeb44 100644
--- a/tools/updater/cmd_flash.c
+++ b/tools/updater/cmd_flash.c
@@ -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);