summaryrefslogtreecommitdiff
path: root/board/amcc
diff options
context:
space:
mode:
Diffstat (limited to 'board/amcc')
-rw-r--r--board/amcc/acadia/cmd_acadia.c6
-rw-r--r--board/amcc/luan/luan.c3
-rw-r--r--board/amcc/makalu/cmd_pll.c13
-rw-r--r--board/amcc/taihu/lcd.c20
-rw-r--r--board/amcc/taihu/taihu.c15
-rw-r--r--board/amcc/taishan/lcd.c20
-rw-r--r--board/amcc/yucca/cmd_yucca.c6
7 files changed, 32 insertions, 51 deletions
diff --git a/board/amcc/acadia/cmd_acadia.c b/board/amcc/acadia/cmd_acadia.c
index 86f86e2b185..6936e510402 100644
--- a/board/amcc/acadia/cmd_acadia.c
+++ b/board/amcc/acadia/cmd_acadia.c
@@ -44,10 +44,8 @@ static int do_bootstrap(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[
u8 *buf;
int cpu_freq;
- if (argc < 3) {
- cmd_usage(cmdtp);
- return 1;
- }
+ if (argc < 3)
+ return cmd_usage(cmdtp);
cpu_freq = simple_strtol(argv[1], NULL, 10);
if (cpu_freq != 267) {
diff --git a/board/amcc/luan/luan.c b/board/amcc/luan/luan.c
index c0368c0389f..c09d7308888 100644
--- a/board/amcc/luan/luan.c
+++ b/board/amcc/luan/luan.c
@@ -223,8 +223,7 @@ int do_l2cache( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[] )
l2cache_status() ? "ON" : "OFF");
return 0;
default:
- cmd_usage(cmdtp);
- return 1;
+ return cmd_usage(cmdtp);
}
return 0;
diff --git a/board/amcc/makalu/cmd_pll.c b/board/amcc/makalu/cmd_pll.c
index 3c0dc5f8969..7f75ad7deec 100644
--- a/board/amcc/makalu/cmd_pll.c
+++ b/board/amcc/makalu/cmd_pll.c
@@ -182,14 +182,14 @@ do_pll_alter (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
char c = '\0';
pll_freq_t pll_freq;
- if (argc < 2) {
- cmd_usage(cmdtp);
- goto ret;
- }
- for (pll_freq = PLL_ebc20; pll_freq < PLL_TOTAL; pll_freq++)
+ if (argc < 2)
+ return cmd_usage(cmdtp);
+
+ for (pll_freq = PLL_ebc20; pll_freq < PLL_TOTAL; pll_freq++) {
if (!strcmp(pll_name[pll_freq], argv[1]))
break;
+ }
switch (pll_freq) {
case PLL_ebc20:
@@ -223,8 +223,7 @@ do_pll_alter (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
default:
printf("Invalid options\n\n");
- cmd_usage(cmdtp);
- goto ret;
+ return cmd_usage(cmdtp);
}
printf("PLL set to %s, "
diff --git a/board/amcc/taihu/lcd.c b/board/amcc/taihu/lcd.c
index 595dee3fcc4..9b2afdabca5 100644
--- a/board/amcc/taihu/lcd.c
+++ b/board/amcc/taihu/lcd.c
@@ -139,10 +139,9 @@ static int do_lcd_clear (cmd_tbl_t * cmdtp, int flag, int argc, char * const arg
static int do_lcd_puts (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
- if (argc < 2) {
- cmd_usage(cmdtp);
- return 1;
- }
+ if (argc < 2)
+ return cmd_usage(cmdtp);
+
lcd_puts(argv[1]);
return 0;
@@ -150,10 +149,9 @@ static int do_lcd_puts (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv
static int do_lcd_putc (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
- if (argc < 2) {
- cmd_usage(cmdtp);
- return 1;
- }
+ if (argc < 2)
+ return cmd_usage(cmdtp);
+
lcd_putc((char)argv[1][0]);
return 0;
@@ -165,10 +163,8 @@ static int do_lcd_cur (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[
ulong dir;
char cur_addr;
- if (argc < 3) {
- cmd_usage(cmdtp);
- return 1;
- }
+ if (argc < 3)
+ return cmd_usage(cmdtp);
count = simple_strtoul(argv[1], NULL, 16);
if (count > 31) {
diff --git a/board/amcc/taihu/taihu.c b/board/amcc/taihu/taihu.c
index 1682cf7c6ad..dd2aba546c1 100644
--- a/board/amcc/taihu/taihu.c
+++ b/board/amcc/taihu/taihu.c
@@ -101,16 +101,12 @@ static int do_led_ctl(cmd_tbl_t* cmd_tp, int flags, int argc, char * const argv[
{
int led_no;
- if (argc != 3) {
- cmd_usage(cmd_tp);
- return -1;
- }
+ if (argc != 3)
+ return cmd_usage(cmd_tp);
led_no = simple_strtoul(argv[1], NULL, 16);
- if (led_no != 1 && led_no != 2) {
- cmd_usage(cmd_tp);
- return -1;
- }
+ if (led_no != 1 && led_no != 2)
+ return cmd_usage(cmd_tp);
if (strcmp(argv[2],"off") == 0x0) {
if (led_no == 1)
@@ -123,8 +119,7 @@ static int do_led_ctl(cmd_tbl_t* cmd_tp, int flags, int argc, char * const argv[
else
gpio_write_bit(31, 0);
} else {
- cmd_usage(cmd_tp);
- return -1;
+ return cmd_usage(cmd_tp);
}
return 0;
diff --git a/board/amcc/taishan/lcd.c b/board/amcc/taishan/lcd.c
index 6a049dfbadc..7f7730a81d1 100644
--- a/board/amcc/taishan/lcd.c
+++ b/board/amcc/taishan/lcd.c
@@ -166,19 +166,17 @@ static int do_lcd_clear(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv
}
static int do_lcd_puts(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
- if (argc < 2) {
- cmd_usage(cmdtp);
- return 1;
- }
+ if (argc < 2)
+ return cmd_usage(cmdtp);
+
lcd_puts(argv[1]);
return 0;
}
static int do_lcd_putc(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
- if (argc < 2) {
- cmd_usage(cmdtp);
- return 1;
- }
+ if (argc < 2)
+ return cmd_usage(cmdtp);
+
lcd_putc((char)argv[1][0]);
return 0;
}
@@ -188,10 +186,8 @@ static int do_lcd_cur(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]
ulong dir;
char cur_addr;
- if (argc < 3) {
- cmd_usage(cmdtp);
- return 1;
- }
+ if (argc < 3)
+ return cmd_usage(cmdtp);
count = simple_strtoul(argv[1], NULL, 16);
if (count > 31) {
diff --git a/board/amcc/yucca/cmd_yucca.c b/board/amcc/yucca/cmd_yucca.c
index cde13e424b5..e9cd333f3a5 100644
--- a/board/amcc/yucca/cmd_yucca.c
+++ b/board/amcc/yucca/cmd_yucca.c
@@ -58,10 +58,8 @@ static int setBootStrapClock(cmd_tbl_t *cmdtp, int incrflag, int flag,
char plbClock[4];
char pcixClock[4];
- if (argc < 3) {
- cmd_usage(cmdtp);
- return 1;
- }
+ if (argc < 3)
+ return cmd_usage(cmdtp);
if (strcmp(argv[2], "prom0") == 0)
chip = IIC0_BOOTPROM_ADDR;