summaryrefslogtreecommitdiff
path: root/common/main.c
diff options
context:
space:
mode:
authorLadislav Michl <ladis@linux-mips.org>2007-04-25 16:01:26 +0200
committerWolfgang Denk <wd@denx.de>2007-05-05 21:34:19 +0200
commit4ec5bd55ed1ffa91a774af298769621f4fbb18c1 (patch)
treede51fd274ad81d8b747759f7f511d26f8115fb8f /common/main.c
parentb7598a43f2b421a713d8135e98a42c37d9eb9df0 (diff)
[PATCH] simplify silent console
Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Acked-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'common/main.c')
-rw-r--r--common/main.c38
1 files changed, 5 insertions, 33 deletions
diff --git a/common/main.c b/common/main.c
index cc4b50f615..d8c0054954 100644
--- a/common/main.c
+++ b/common/main.c
@@ -112,14 +112,6 @@ static __inline__ int abortboot(int bootdelay)
u_int presskey_max = 0;
u_int i;
-#ifdef CONFIG_SILENT_CONSOLE
- if (gd->flags & GD_FLG_SILENT) {
- /* Restore serial console */
- console_assign (stdout, "serial");
- console_assign (stderr, "serial");
- }
-#endif
-
# ifdef CONFIG_AUTOBOOT_PROMPT
printf (CONFIG_AUTOBOOT_PROMPT, bootdelay);
# endif
@@ -199,14 +191,8 @@ static __inline__ int abortboot(int bootdelay)
# endif
#ifdef CONFIG_SILENT_CONSOLE
- if (abort) {
- /* permanently enable normal console output */
- gd->flags &= ~(GD_FLG_SILENT);
- } else if (gd->flags & GD_FLG_SILENT) {
- /* Restore silent console */
- console_assign (stdout, "nulldev");
- console_assign (stderr, "nulldev");
- }
+ if (abort)
+ gd->flags &= ~GD_FLG_SILENT;
#endif
return abort;
@@ -222,14 +208,6 @@ static __inline__ int abortboot(int bootdelay)
{
int abort = 0;
-#ifdef CONFIG_SILENT_CONSOLE
- if (gd->flags & GD_FLG_SILENT) {
- /* Restore serial console */
- console_assign (stdout, "serial");
- console_assign (stderr, "serial");
- }
-#endif
-
#ifdef CONFIG_MENUPROMPT
printf(CONFIG_MENUPROMPT, bootdelay);
#else
@@ -245,7 +223,7 @@ static __inline__ int abortboot(int bootdelay)
if (tstc()) { /* we got a key press */
(void) getc(); /* consume input */
puts ("\b\b\b 0");
- abort = 1; /* don't auto boot */
+ abort = 1; /* don't auto boot */
}
}
#endif
@@ -275,14 +253,8 @@ static __inline__ int abortboot(int bootdelay)
putc ('\n');
#ifdef CONFIG_SILENT_CONSOLE
- if (abort) {
- /* permanently enable normal console output */
- gd->flags &= ~(GD_FLG_SILENT);
- } else if (gd->flags & GD_FLG_SILENT) {
- /* Restore silent console */
- console_assign (stdout, "nulldev");
- console_assign (stderr, "nulldev");
- }
+ if (abort)
+ gd->flags &= ~GD_FLG_SILENT;
#endif
return abort;