of/irq: Create of_irq_parse_and_map_pci() to consolidate arch code.

Several architectures open code effectively the same code block for
finding and mapping PCI irqs. This patch consolidates it down to a
single function.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
Acked-by: Michal Simek <monstr@monstr.eu>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
Grant Likely 2013-09-19 16:44:55 -05:00
parent f7578496a6
commit 16b84e5a50
7 changed files with 31 additions and 67 deletions

View file

@ -105,7 +105,6 @@ struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus)
static int x86_of_pci_irq_enable(struct pci_dev *dev)
{
struct of_phandle_args oirq;
u32 virq;
int ret;
u8 pin;
@ -116,11 +115,7 @@ static int x86_of_pci_irq_enable(struct pci_dev *dev)
if (!pin)
return 0;
ret = of_irq_parse_pci(dev, &oirq);
if (ret)
return ret;
virq = irq_create_of_mapping(&oirq);
virq = of_irq_parse_and_map_pci(dev, 0, 0);
if (virq == 0)
return -EINVAL;
dev->irq = virq;