]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
parisc: cleanup console handling
authorJiri Slaby <jslaby@suse.cz>
Thu, 4 Nov 2010 15:20:21 +0000 (16:20 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 16 Nov 2010 20:50:18 +0000 (12:50 -0800)
* use newly added for_each_console for iterating consoles
* add proper console locking
* do not initialize tmp twice
* no need to declare console_drivers, it's already done in console.h

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Kyle McMartin <kyle@mcmartin.ca>
Cc: Helge Deller <deller@gmx.de>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: linux-parisc@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/parisc/kernel/pdc_cons.c

index 66d1f17fdb9406acaaaf11ea9b9436a58c26ea1e..11bdd68e576239bffe235dc8b4b3d3a38709beed 100644 (file)
@@ -92,8 +92,6 @@ static int pdc_console_setup(struct console *co, char *options)
 
 static struct timer_list pdc_console_timer;
 
-extern struct console * console_drivers;
-
 static int pdc_console_tty_open(struct tty_struct *tty, struct file *filp)
 {
 
@@ -169,11 +167,13 @@ static int __init pdc_console_tty_driver_init(void)
         * It is unregistered if the pdc console was not selected as the
         * primary console. */
 
-       struct console *tmp = console_drivers;
+       struct console *tmp;
 
-       for (tmp = console_drivers; tmp; tmp = tmp->next)
+       acquire_console_sem();
+       for_each_console(tmp)
                if (tmp == &pdc_cons)
                        break;
+       release_console_sem();
 
        if (!tmp) {
                printk(KERN_INFO "PDC console driver not registered anymore, not creating %s\n", pdc_cons.name);