aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-05-07 11:44:09 -0400
committerThomas Gleixner <tglx@linutronix.de>2014-05-16 08:05:19 -0400
commitbe47be6c28a83dd8b3c5540d0be3675af1ac7b2e (patch)
tree3f96448e34377750b64f72e37dcec44042b2298f /arch/x86/kernel
parent59b47ddc0b4d7ea8a625512e802832730c1feeb4 (diff)
x86: ioapic: Use irq_alloc/free_hwirq()
No functional change just less crap. This does not replace the requirement to move x86 to irq domains, but it limits the mess to some degree. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Grant Likely <grant.likely@linaro.org> Cc: Tony Luck <tony.luck@intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: x86@kernel.org Link: http://lkml.kernel.org/r/20140507154335.749579081@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/apic/io_apic.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index b7175c0c552c..3c17b25d159d 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -3169,8 +3169,8 @@ int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc,
3169 3169
3170int native_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) 3170int native_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
3171{ 3171{
3172 unsigned int irq, irq_want;
3173 struct msi_desc *msidesc; 3172 struct msi_desc *msidesc;
3173 unsigned int irq;
3174 int node, ret; 3174 int node, ret;
3175 3175
3176 /* Multiple MSI vectors only supported with interrupt remapping */ 3176 /* Multiple MSI vectors only supported with interrupt remapping */
@@ -3178,28 +3178,25 @@ int native_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
3178 return 1; 3178 return 1;
3179 3179
3180 node = dev_to_node(&dev->dev); 3180 node = dev_to_node(&dev->dev);
3181 irq_want = nr_irqs_gsi; 3181
3182 list_for_each_entry(msidesc, &dev->msi_list, list) { 3182 list_for_each_entry(msidesc, &dev->msi_list, list) {
3183 irq = create_irq_nr(irq_want, node); 3183 irq = irq_alloc_hwirq(node);
3184 if (irq == 0) 3184 if (!irq)
3185 return -ENOSPC; 3185 return -ENOSPC;
3186 3186
3187 irq_want = irq + 1;
3188
3189 ret = setup_msi_irq(dev, msidesc, irq, 0); 3187 ret = setup_msi_irq(dev, msidesc, irq, 0);
3190 if (ret < 0) 3188 if (ret < 0) {
3191 goto error; 3189 irq_free_hwirq(irq);
3190 return ret;
3191 }
3192
3192 } 3193 }
3193 return 0; 3194 return 0;
3194
3195error:
3196 destroy_irq(irq);
3197 return ret;
3198} 3195}
3199 3196
3200void native_teardown_msi_irq(unsigned int irq) 3197void native_teardown_msi_irq(unsigned int irq)
3201{ 3198{
3202 destroy_irq(irq); 3199 irq_free_hwirq(irq);
3203} 3200}
3204 3201
3205#ifdef CONFIG_DMAR_TABLE 3202#ifdef CONFIG_DMAR_TABLE