aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/i386/kernel/io_apic.c23
-rw-r--r--arch/x86_64/kernel/io_apic.c23
2 files changed, 16 insertions, 30 deletions
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
index 43ffdd012d26..5a1a5412015c 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/i386/kernel/io_apic.c
@@ -1205,21 +1205,14 @@ static struct hw_interrupt_type ioapic_edge_type;
1205 1205
1206static inline void ioapic_register_intr(int irq, int vector, unsigned long trigger) 1206static inline void ioapic_register_intr(int irq, int vector, unsigned long trigger)
1207{ 1207{
1208 if (use_pci_vector() && !platform_legacy_irq(irq)) { 1208 unsigned idx = use_pci_vector() && !platform_legacy_irq(irq) ? vector : irq;
1209 if ((trigger == IOAPIC_AUTO && IO_APIC_irq_trigger(irq)) || 1209
1210 trigger == IOAPIC_LEVEL) 1210 if ((trigger == IOAPIC_AUTO && IO_APIC_irq_trigger(irq)) ||
1211 irq_desc[vector].handler = &ioapic_level_type; 1211 trigger == IOAPIC_LEVEL)
1212 else 1212 irq_desc[idx].handler = &ioapic_level_type;
1213 irq_desc[vector].handler = &ioapic_edge_type; 1213 else
1214 set_intr_gate(vector, interrupt[vector]); 1214 irq_desc[idx].handler = &ioapic_edge_type;
1215 } else { 1215 set_intr_gate(vector, interrupt[idx]);
1216 if ((trigger == IOAPIC_AUTO && IO_APIC_irq_trigger(irq)) ||
1217 trigger == IOAPIC_LEVEL)
1218 irq_desc[irq].handler = &ioapic_level_type;
1219 else
1220 irq_desc[irq].handler = &ioapic_edge_type;
1221 set_intr_gate(vector, interrupt[irq]);
1222 }
1223} 1216}
1224 1217
1225static void __init setup_IO_APIC_irqs(void) 1218static void __init setup_IO_APIC_irqs(void)
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
index 062b10daebac..15b2f6932de1 100644
--- a/arch/x86_64/kernel/io_apic.c
+++ b/arch/x86_64/kernel/io_apic.c
@@ -876,21 +876,14 @@ static struct hw_interrupt_type ioapic_edge_type;
876 876
877static inline void ioapic_register_intr(int irq, int vector, unsigned long trigger) 877static inline void ioapic_register_intr(int irq, int vector, unsigned long trigger)
878{ 878{
879 if (use_pci_vector() && !platform_legacy_irq(irq)) { 879 unsigned idx = use_pci_vector() && !platform_legacy_irq(irq) ? vector : irq;
880 if ((trigger == IOAPIC_AUTO && IO_APIC_irq_trigger(irq)) || 880
881 trigger == IOAPIC_LEVEL) 881 if ((trigger == IOAPIC_AUTO && IO_APIC_irq_trigger(irq)) ||
882 irq_desc[vector].handler = &ioapic_level_type; 882 trigger == IOAPIC_LEVEL)
883 else 883 irq_desc[idx].handler = &ioapic_level_type;
884 irq_desc[vector].handler = &ioapic_edge_type; 884 else
885 set_intr_gate(vector, interrupt[vector]); 885 irq_desc[idx].handler = &ioapic_edge_type;
886 } else { 886 set_intr_gate(vector, interrupt[idx]);
887 if ((trigger == IOAPIC_AUTO && IO_APIC_irq_trigger(irq)) ||
888 trigger == IOAPIC_LEVEL)
889 irq_desc[irq].handler = &ioapic_level_type;
890 else
891 irq_desc[irq].handler = &ioapic_edge_type;
892 set_intr_gate(vector, interrupt[irq]);
893 }
894} 887}
895 888
896static void __init setup_IO_APIC_irqs(void) 889static void __init setup_IO_APIC_irqs(void)