]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
[PATCH] simplify silent console
authorLadislav Michl <ladis@linux-mips.org>
Wed, 25 Apr 2007 14:01:26 +0000 (16:01 +0200)
committerWolfgang Denk <wd@denx.de>
Sat, 5 May 2007 19:34:19 +0000 (21:34 +0200)
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Acked-by: Stefan Roese <sr@denx.de>
common/console.c
common/main.c

index e9f23bec1820f178e3f4a67e3241182a0c65dc9d..d8a0cb6c7e8a1d43e43ad066514e23a72f88327e 100644 (file)
@@ -494,13 +494,7 @@ int console_init_r (void)
        /* suppress all output if splash screen is enabled and we have
           a bmp to display                                            */
        if (getenv("splashimage") != NULL)
-               outputdev = search_device (DEV_FLAGS_OUTPUT, "nulldev");
-#endif
-
-#ifdef CONFIG_SILENT_CONSOLE
-       /* Suppress all output if "silent" mode requested               */
-       if (gd->flags & GD_FLG_SILENT)
-               outputdev = search_device (DEV_FLAGS_OUTPUT, "nulldev");
+               gd->flags |= GD_FLG_SILENT;
 #endif
 
        /* Scan devices looking for input and output devices */
index cc4b50f615ab070c806773cfa57661f1dd889bbe..d8c0054954834efe07b7418e96493f5d50f8eff9 100644 (file)
@@ -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;