diff options
author | Grant Likely <grant.likely@linaro.org> | 2013-09-19 17:44:55 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@linaro.org> | 2013-10-24 06:50:36 -0400 |
commit | 16b84e5a505c790538e534ad8dfda9c288691e40 (patch) | |
tree | 887e4da0c9cdf408350230165cf72730cec599e6 /drivers/pci | |
parent | f7578496a671a96e501f16a5104893275e32c33a (diff) |
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>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/host/pci-mvebu.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c index 3a8d01ec50f7..07ddb3a13c6e 100644 --- a/drivers/pci/host/pci-mvebu.c +++ b/drivers/pci/host/pci-mvebu.c | |||
@@ -645,18 +645,6 @@ static int __init mvebu_pcie_setup(int nr, struct pci_sys_data *sys) | |||
645 | return 1; | 645 | return 1; |
646 | } | 646 | } |
647 | 647 | ||
648 | static int __init mvebu_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | ||
649 | { | ||
650 | struct of_phandle_args oirq; | ||
651 | int ret; | ||
652 | |||
653 | ret = of_irq_parse_pci(dev, &oirq); | ||
654 | if (ret) | ||
655 | return ret; | ||
656 | |||
657 | return irq_create_of_mapping(&oirq); | ||
658 | } | ||
659 | |||
660 | static struct pci_bus *mvebu_pcie_scan_bus(int nr, struct pci_sys_data *sys) | 648 | static struct pci_bus *mvebu_pcie_scan_bus(int nr, struct pci_sys_data *sys) |
661 | { | 649 | { |
662 | struct mvebu_pcie *pcie = sys_to_pcie(sys); | 650 | struct mvebu_pcie *pcie = sys_to_pcie(sys); |
@@ -705,7 +693,7 @@ static void __init mvebu_pcie_enable(struct mvebu_pcie *pcie) | |||
705 | hw.private_data = (void **)&pcie; | 693 | hw.private_data = (void **)&pcie; |
706 | hw.setup = mvebu_pcie_setup; | 694 | hw.setup = mvebu_pcie_setup; |
707 | hw.scan = mvebu_pcie_scan_bus; | 695 | hw.scan = mvebu_pcie_scan_bus; |
708 | hw.map_irq = mvebu_pcie_map_irq; | 696 | hw.map_irq = of_irq_parse_and_map_pci; |
709 | hw.ops = &mvebu_pcie_ops; | 697 | hw.ops = &mvebu_pcie_ops; |
710 | hw.align_resource = mvebu_pcie_align_resource; | 698 | hw.align_resource = mvebu_pcie_align_resource; |
711 | 699 | ||