Skip to content

Commit

Permalink
PCI: rcar: Use new OF interrupt mapping when possible
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
  • Loading branch information
Lucas Stach authored and Bjorn Helgaas committed Apr 15, 2014
1 parent c9eaa44 commit b9bfe1b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/pci/host/pci-rcar-gen2.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of_pci.h>
#include <linux/pci.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
Expand Down Expand Up @@ -180,8 +181,13 @@ static int rcar_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
struct pci_sys_data *sys = dev->bus->sysdata;
struct rcar_pci_priv *priv = sys->private_data;
int irq;

irq = of_irq_parse_and_map_pci(dev, slot, pin);
if (!irq)
irq = priv->irq;

return priv->irq;
return irq;
}

#ifdef CONFIG_PCI_DEBUG
Expand Down

0 comments on commit b9bfe1b

Please sign in to comment.