diff options
author | Jiri Slaby <jslaby@suse.cz> | 2010-11-04 11:20:21 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-11-16 15:50:18 -0500 |
commit | 597c606f560cf7ef6029152fa7574bddbfb0252f (patch) | |
tree | 0d0fcf0087de96cffea0853eac87fce048c6f00d /arch | |
parent | 23308ba54dcdb54481163bfb07dd8aeca76a7a2e (diff) |
parisc: cleanup console handling
* 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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/parisc/kernel/pdc_cons.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c index 66d1f17fdb94..11bdd68e5762 100644 --- a/arch/parisc/kernel/pdc_cons.c +++ b/arch/parisc/kernel/pdc_cons.c | |||
@@ -92,8 +92,6 @@ static int pdc_console_setup(struct console *co, char *options) | |||
92 | 92 | ||
93 | static struct timer_list pdc_console_timer; | 93 | static struct timer_list pdc_console_timer; |
94 | 94 | ||
95 | extern struct console * console_drivers; | ||
96 | |||
97 | static int pdc_console_tty_open(struct tty_struct *tty, struct file *filp) | 95 | static int pdc_console_tty_open(struct tty_struct *tty, struct file *filp) |
98 | { | 96 | { |
99 | 97 | ||
@@ -169,11 +167,13 @@ static int __init pdc_console_tty_driver_init(void) | |||
169 | * It is unregistered if the pdc console was not selected as the | 167 | * It is unregistered if the pdc console was not selected as the |
170 | * primary console. */ | 168 | * primary console. */ |
171 | 169 | ||
172 | struct console *tmp = console_drivers; | 170 | struct console *tmp; |
173 | 171 | ||
174 | for (tmp = console_drivers; tmp; tmp = tmp->next) | 172 | acquire_console_sem(); |
173 | for_each_console(tmp) | ||
175 | if (tmp == &pdc_cons) | 174 | if (tmp == &pdc_cons) |
176 | break; | 175 | break; |
176 | release_console_sem(); | ||
177 | 177 | ||
178 | if (!tmp) { | 178 | if (!tmp) { |
179 | printk(KERN_INFO "PDC console driver not registered anymore, not creating %s\n", pdc_cons.name); | 179 | printk(KERN_INFO "PDC console driver not registered anymore, not creating %s\n", pdc_cons.name); |