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 /arch/x86/kernel | |
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 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/devicetree.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c index d39948f654a0..69c826a3d07e 100644 --- a/arch/x86/kernel/devicetree.c +++ b/arch/x86/kernel/devicetree.c | |||
@@ -105,7 +105,6 @@ struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus) | |||
105 | 105 | ||
106 | static int x86_of_pci_irq_enable(struct pci_dev *dev) | 106 | static int x86_of_pci_irq_enable(struct pci_dev *dev) |
107 | { | 107 | { |
108 | struct of_phandle_args oirq; | ||
109 | u32 virq; | 108 | u32 virq; |
110 | int ret; | 109 | int ret; |
111 | u8 pin; | 110 | u8 pin; |
@@ -116,11 +115,7 @@ static int x86_of_pci_irq_enable(struct pci_dev *dev) | |||
116 | if (!pin) | 115 | if (!pin) |
117 | return 0; | 116 | return 0; |
118 | 117 | ||
119 | ret = of_irq_parse_pci(dev, &oirq); | 118 | virq = of_irq_parse_and_map_pci(dev, 0, 0); |
120 | if (ret) | ||
121 | return ret; | ||
122 | |||
123 | virq = irq_create_of_mapping(&oirq); | ||
124 | if (virq == 0) | 119 | if (virq == 0) |
125 | return -EINVAL; | 120 | return -EINVAL; |
126 | dev->irq = virq; | 121 | dev->irq = virq; |