public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Robin Getz <rgetz@blackfin.uclinux.org>
Cc: Mike Frysinger <vapier.adi@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: Early printk behaviour
Date: Mon, 20 Aug 2007 10:01:12 +0200	[thread overview]
Message-ID: <46C94A48.4060309@redhat.com> (raw)
In-Reply-To: <200708171700.29647.rgetz@blackfin.uclinux.org>

Robin Getz wrote:

>> Hmm, yes, should be doable in generic code.  Check whenever the current
>> console has CON_BOOT set and if so unregister it.
> 
> Something like:
> 
> +++ kernel/printk.c     (working copy)
> +int __init disable_boot_consoles(void)
> +{
> +       struct console *con;
> +
> +       for (con = console_drivers; con; con = con->next) {
> +               if (con->flags & CON_BOOT) {
> +                       printk(KERN_INFO "Unregister BootConsole %s%d\n",
> +                               con->name, con->index);
> +                       unregister_console(con);
> +               }
> +       }
> +       return 0;
> +}
> +late_initcall(disable_boot_consoles);

Yep, that should work.  You can drop the loop though.  You can't
register a boot console if another console exists, and the first
non-boot console replaces the boot console, thus you never ever have
more than one console in case the boot console is still active.

The printk should be all lowercase like the other printk's in the file.

Other than that it loosk fine.

cheers,
  Gerd


  parent reply	other threads:[~2007-08-20  8:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-16  2:34 Early printk behaviour Robin Getz
2007-08-16  7:45 ` Gerd Hoffmann
2007-08-16 16:47   ` Mike Frysinger
2007-08-17  7:49     ` Gerd Hoffmann
2007-08-17 21:00       ` Robin Getz
2007-08-17 21:09         ` Mike Frysinger
2007-08-17 21:29           ` Robin Getz
2007-08-20  8:01         ` Gerd Hoffmann [this message]
2007-08-16 18:56   ` Robin Getz
2007-08-17 17:36   ` [draft] Blackfin Early Printk implmentation Robin Getz
2007-08-17 17:57     ` Mike Frysinger
2007-08-17 18:25       ` Robin Getz
2007-08-17 18:43         ` Mike Frysinger
2007-08-17 17:59     ` Sam Ravnborg
2007-08-17 20:07       ` Robin Getz
2007-08-18  6:23         ` Sam Ravnborg
2007-08-18 15:37           ` Robin Getz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46C94A48.4060309@redhat.com \
    --to=kraxel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rgetz@blackfin.uclinux.org \
    --cc=vapier.adi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox