mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
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:
parent
f7578496a6
commit
16b84e5a50
7 changed files with 31 additions and 67 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue