aboutsummaryrefslogtreecommitdiff
path: root/board/tqc
diff options
context:
space:
mode:
authorWolfgang Denk2010-07-17 01:06:04 +0200
committerWolfgang Denk2010-07-24 20:43:57 +0200
commit47e26b1bf91ddef69f4a3892815c857db094cef9 (patch)
tree7d688085d23779707c637703273f79bd3cca83e0 /board/tqc
parentdebb6299ac1180a08f29f88c6d782b21a9c98707 (diff)
cmd_usage(): simplify return code handling
Lots of code use this construct: cmd_usage(cmdtp); return 1; Change cmd_usage() let it return 1 - then we can replace all these ocurrances by return cmd_usage(cmdtp); This fixes a few places with incorrect return code handling, too. Signed-off-by: Wolfgang Denk <wd@denx.de>
Diffstat (limited to 'board/tqc')
-rw-r--r--board/tqc/tqm5200/cmd_stk52xx.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/board/tqc/tqm5200/cmd_stk52xx.c b/board/tqc/tqm5200/cmd_stk52xx.c
index 0db705049ff..0789c5848eb 100644
--- a/board/tqc/tqm5200/cmd_stk52xx.c
+++ b/board/tqc/tqm5200/cmd_stk52xx.c
@@ -327,8 +327,7 @@ static int cmd_sound(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
switch (argc) {
case 0:
case 1:
- cmd_usage(cmdtp);
- return 1;
+ return cmd_usage(cmdtp);
case 2:
if (strncmp(argv[1],"saw",3) == 0) {
printf ("Play sawtooth\n");
@@ -342,8 +341,7 @@ static int cmd_sound(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return rcode;
}
- cmd_usage(cmdtp);
- return 1;
+ return cmd_usage(cmdtp);
case 3:
if (strncmp(argv[1],"saw",3) == 0) {
duration = simple_strtoul(argv[2], NULL, 10);
@@ -358,8 +356,7 @@ static int cmd_sound(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
LEFT_RIGHT);
return rcode;
}
- cmd_usage(cmdtp);
- return 1;
+ return cmd_usage(cmdtp);
case 4:
if (strncmp(argv[1],"saw",3) == 0) {
duration = simple_strtoul(argv[2], NULL, 10);
@@ -382,8 +379,7 @@ static int cmd_sound(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
pcm1772_write_reg((uchar)reg, (uchar)val);
return 0;
}
- cmd_usage(cmdtp);
- return 1;
+ return cmd_usage(cmdtp);
case 5:
if (strncmp(argv[1],"saw",3) == 0) {
duration = simple_strtoul(argv[2], NULL, 10);
@@ -412,8 +408,7 @@ static int cmd_sound(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
channel);
return rcode;
}
- cmd_usage(cmdtp);
- return 1;
+ return cmd_usage(cmdtp);
}
printf ("Usage:\nsound cmd [arg1] [arg2] ...\n");
return 1;
@@ -513,8 +508,7 @@ static int cmd_beep(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
channel = LEFT_RIGHT;
break;
default:
- cmd_usage(cmdtp);
- return 1;
+ return cmd_usage(cmdtp);
}
if ((tmp = getenv ("volume")) != NULL) {