aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/apic/io_apic.c34
1 files changed, 3 insertions, 31 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 51c8bd11c136..a655bd8fb063 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -3679,45 +3679,17 @@ int __init arch_probe_nr_irqs(void)
3679static int __io_apic_set_pci_routing(struct device *dev, int irq, 3679static int __io_apic_set_pci_routing(struct device *dev, int irq,
3680 struct io_apic_irq_attr *irq_attr) 3680 struct io_apic_irq_attr *irq_attr)
3681{ 3681{
3682 struct irq_cfg *cfg;
3683 int node; 3682 int node;
3684 int ioapic, pin;
3685 int trigger, polarity;
3686 3683
3687 ioapic = irq_attr->ioapic;
3688 if (!IO_APIC_IRQ(irq)) { 3684 if (!IO_APIC_IRQ(irq)) {
3689 apic_printk(APIC_QUIET,KERN_ERR "IOAPIC[%d]: Invalid reference to IRQ 0\n", 3685 apic_printk(APIC_QUIET,KERN_ERR "IOAPIC[%d]: Invalid reference to IRQ 0\n",
3690 ioapic); 3686 irq_attr->ioapic);
3691 return -EINVAL; 3687 return -EINVAL;
3692 } 3688 }
3693 3689
3694 if (dev) 3690 node = dev ? dev_to_node(dev) : cpu_to_node(0);
3695 node = dev_to_node(dev);
3696 else
3697 node = cpu_to_node(0);
3698
3699 cfg = alloc_irq_and_cfg_at(irq, node);
3700 if (!cfg)
3701 return 0;
3702
3703 pin = irq_attr->ioapic_pin;
3704 trigger = irq_attr->trigger;
3705 polarity = irq_attr->polarity;
3706
3707 /*
3708 * IRQs < 16 are already in the irq_2_pin[] map
3709 */
3710 if (irq >= legacy_pic->nr_legacy_irqs) {
3711 if (__add_pin_to_irq_node(cfg, node, ioapic, pin)) {
3712 printk(KERN_INFO "can not add pin %d for irq %d\n",
3713 pin, irq);
3714 return 0;
3715 }
3716 }
3717
3718 setup_ioapic_irq(ioapic, pin, irq, cfg, trigger, polarity);
3719 3691
3720 return 0; 3692 return io_apic_setup_irq_pin(irq, node, irq_attr);
3721} 3693}
3722 3694
3723int io_apic_set_pci_routing(struct device *dev, int irq, 3695int io_apic_set_pci_routing(struct device *dev, int irq,