aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2007-02-20 06:08:45 -0500
committerRalf Baechle <ralf@linux-mips.org>2007-02-20 12:11:55 -0500
commita0be2f7999aaff97962fe4240ab2ca12a394884c (patch)
tree53406ef7f5565cb9a8b514a88bac9966b550547b
parenta9b69d0c0c928b4a78a0da32a903ae47b0ad09e7 (diff)
[MIPS] Drop __init from init_8259A()
init_8259A() is called from i8259A_resume() so should not be marked as __init. And add some tests for whether 8259A was already initialized or not. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/kernel/i8259.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/arch/mips/kernel/i8259.c b/arch/mips/kernel/i8259.c
index b33ba6cd7f5b..9c79703979b2 100644
--- a/arch/mips/kernel/i8259.c
+++ b/arch/mips/kernel/i8259.c
@@ -28,7 +28,7 @@
28 * moves to arch independent land 28 * moves to arch independent land
29 */ 29 */
30 30
31static int i8259A_auto_eoi; 31static int i8259A_auto_eoi = -1;
32DEFINE_SPINLOCK(i8259A_lock); 32DEFINE_SPINLOCK(i8259A_lock);
33/* some platforms call this... */ 33/* some platforms call this... */
34void mask_and_ack_8259A(unsigned int); 34void mask_and_ack_8259A(unsigned int);
@@ -216,7 +216,8 @@ spurious_8259A_irq:
216 216
217static int i8259A_resume(struct sys_device *dev) 217static int i8259A_resume(struct sys_device *dev)
218{ 218{
219 init_8259A(i8259A_auto_eoi); 219 if (i8259A_auto_eoi >= 0)
220 init_8259A(i8259A_auto_eoi);
220 return 0; 221 return 0;
221} 222}
222 223
@@ -226,8 +227,10 @@ static int i8259A_shutdown(struct sys_device *dev)
226 * the kernel initialization code can get it 227 * the kernel initialization code can get it
227 * out of. 228 * out of.
228 */ 229 */
229 outb(0xff, PIC_MASTER_IMR); /* mask all of 8259A-1 */ 230 if (i8259A_auto_eoi >= 0) {
230 outb(0xff, PIC_SLAVE_IMR); /* mask all of 8259A-1 */ 231 outb(0xff, PIC_MASTER_IMR); /* mask all of 8259A-1 */
232 outb(0xff, PIC_SLAVE_IMR); /* mask all of 8259A-1 */
233 }
231 return 0; 234 return 0;
232} 235}
233 236
@@ -252,7 +255,7 @@ static int __init i8259A_init_sysfs(void)
252 255
253device_initcall(i8259A_init_sysfs); 256device_initcall(i8259A_init_sysfs);
254 257
255void __init init_8259A(int auto_eoi) 258void init_8259A(int auto_eoi)
256{ 259{
257 unsigned long flags; 260 unsigned long flags;
258 261