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>
This commit is contained in:
parent
59b47ddc0b
commit
be47be6c28
|
@ -3169,8 +3169,8 @@ int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc,
|
||||||
|
|
||||||
int native_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
|
int native_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
|
||||||
{
|
{
|
||||||
unsigned int irq, irq_want;
|
|
||||||
struct msi_desc *msidesc;
|
struct msi_desc *msidesc;
|
||||||
|
unsigned int irq;
|
||||||
int node, ret;
|
int node, ret;
|
||||||
|
|
||||||
/* Multiple MSI vectors only supported with interrupt remapping */
|
/* 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)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
node = dev_to_node(&dev->dev);
|
node = dev_to_node(&dev->dev);
|
||||||
irq_want = nr_irqs_gsi;
|
|
||||||
list_for_each_entry(msidesc, &dev->msi_list, list) {
|
list_for_each_entry(msidesc, &dev->msi_list, list) {
|
||||||
irq = create_irq_nr(irq_want, node);
|
irq = irq_alloc_hwirq(node);
|
||||||
if (irq == 0)
|
if (!irq)
|
||||||
return -ENOSPC;
|
return -ENOSPC;
|
||||||
|
|
||||||
irq_want = irq + 1;
|
|
||||||
|
|
||||||
ret = setup_msi_irq(dev, msidesc, irq, 0);
|
ret = setup_msi_irq(dev, msidesc, irq, 0);
|
||||||
if (ret < 0)
|
if (ret < 0) {
|
||||||
goto error;
|
irq_free_hwirq(irq);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
|
||||||
destroy_irq(irq);
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void native_teardown_msi_irq(unsigned int irq)
|
void native_teardown_msi_irq(unsigned int irq)
|
||||||
{
|
{
|
||||||
destroy_irq(irq);
|
irq_free_hwirq(irq);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DMAR_TABLE
|
#ifdef CONFIG_DMAR_TABLE
|
||||||
|
|
Loading…
Reference in New Issue