PCI: tegra: Use new OF interrupt mapping when possible
authorLucas Stach <l.stach@pengutronix.de>
Mon, 14 Apr 2014 20:56:51 +0000 (14:56 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 14 Apr 2014 20:56:51 +0000 (14:56 -0600)
Use new OF interrupt mapping (of_irq_parse_and_map_pci()) when possible.
This is the recommended method of doing the IRQ mapping.  For old
devicetrees we fall back to the previous practice.

This allows interrupts to be remapped across bridges.

Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
drivers/pci/host/pci-tegra.c

index 330f7e3a32dd9f3694a09844106b551751235296..083cf37ca04752be2cdb5658255ac55df450fa78 100644 (file)
@@ -639,10 +639,15 @@ static int tegra_pcie_setup(int nr, struct pci_sys_data *sys)
 static int tegra_pcie_map_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
 {
        struct tegra_pcie *pcie = sys_to_pcie(pdev->bus->sysdata);
+       int irq;
 
        tegra_cpuidle_pcie_irqs_in_use();
 
-       return pcie->irq;
+       irq = of_irq_parse_and_map_pci(pdev, slot, pin);
+       if (!irq)
+               irq = pcie->irq;
+
+       return irq;
 }
 
 static void tegra_pcie_add_bus(struct pci_bus *bus)