Commit 8885b7b637fa9aca7e1b00581a0173c6956966d3
Committed by
Bjorn Helgaas
1 parent
3ddbebf878
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
PCI: Provide a default pcibios_update_irq()
Most architectures implement this in exactly the same way. Instead of having each architecture duplicate this function, provide a single implementation in the core and make it a weak symbol so that it can be overridden on architectures where it is required. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Showing 14 changed files with 5 additions and 89 deletions Side-by-side Diff
- arch/alpha/kernel/pci.c
- arch/arm/kernel/bios32.c
- arch/ia64/pci/pci.c
- arch/m68k/kernel/pcibios.c
- arch/mips/pci/pci.c
- arch/sh/drivers/pci/pci.c
- arch/sparc/kernel/leon_pci.c
- arch/sparc/kernel/pci.c
- arch/tile/kernel/pci.c
- arch/tile/kernel/pci_gx.c
- arch/unicore32/kernel/pci.c
- arch/x86/pci/visws.c
- arch/xtensa/kernel/pci.c
- drivers/pci/setup-irq.c
arch/alpha/kernel/pci.c
arch/arm/kernel/bios32.c
... | ... | @@ -270,15 +270,6 @@ |
270 | 270 | } |
271 | 271 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8152, pci_fixup_it8152); |
272 | 272 | |
273 | - | |
274 | - | |
275 | -void pcibios_update_irq(struct pci_dev *dev, int irq) | |
276 | -{ | |
277 | - if (debug_pci) | |
278 | - printk("PCI: Assigning IRQ %02d to %s\n", irq, pci_name(dev)); | |
279 | - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | |
280 | -} | |
281 | - | |
282 | 273 | /* |
283 | 274 | * If the bus contains any of these devices, then we must not turn on |
284 | 275 | * parity checking of any kind. Currently this is CyberPro 20x0 only. |
arch/ia64/pci/pci.c
... | ... | @@ -461,14 +461,6 @@ |
461 | 461 | /* No special bus mastering setup handling */ |
462 | 462 | } |
463 | 463 | |
464 | -void | |
465 | -pcibios_update_irq (struct pci_dev *dev, int irq) | |
466 | -{ | |
467 | - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | |
468 | - | |
469 | - /* ??? FIXME -- record old value for shutdown. */ | |
470 | -} | |
471 | - | |
472 | 464 | int |
473 | 465 | pcibios_enable_device (struct pci_dev *dev, int mask) |
474 | 466 | { |
arch/m68k/kernel/pcibios.c
arch/mips/pci/pci.c
... | ... | @@ -313,12 +313,6 @@ |
313 | 313 | } |
314 | 314 | } |
315 | 315 | |
316 | -void | |
317 | -pcibios_update_irq(struct pci_dev *dev, int irq) | |
318 | -{ | |
319 | - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | |
320 | -} | |
321 | - | |
322 | 316 | #ifdef CONFIG_HOTPLUG |
323 | 317 | EXPORT_SYMBOL(PCIBIOS_MIN_IO); |
324 | 318 | EXPORT_SYMBOL(PCIBIOS_MIN_MEM); |
arch/sh/drivers/pci/pci.c
... | ... | @@ -192,11 +192,6 @@ |
192 | 192 | return pci_enable_resources(dev, mask); |
193 | 193 | } |
194 | 194 | |
195 | -void pcibios_update_irq(struct pci_dev *dev, int irq) | |
196 | -{ | |
197 | - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | |
198 | -} | |
199 | - | |
200 | 195 | static void __init |
201 | 196 | pcibios_bus_report_status_early(struct pci_channel *hose, |
202 | 197 | int top_bus, int current_bus, |
arch/sparc/kernel/leon_pci.c
... | ... | @@ -102,15 +102,6 @@ |
102 | 102 | return pci_enable_resources(dev, mask); |
103 | 103 | } |
104 | 104 | |
105 | -void pcibios_update_irq(struct pci_dev *dev, int irq) | |
106 | -{ | |
107 | -#ifdef CONFIG_PCI_DEBUG | |
108 | - printk(KERN_DEBUG "LEONPCI: Assigning IRQ %02d to %s\n", irq, | |
109 | - pci_name(dev)); | |
110 | -#endif | |
111 | - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | |
112 | -} | |
113 | - | |
114 | 105 | /* in/out routines taken from pcic.c |
115 | 106 | * |
116 | 107 | * This probably belongs here rather than ioport.c because |
arch/sparc/kernel/pci.c
arch/tile/kernel/pci.c
... | ... | @@ -404,14 +404,6 @@ |
404 | 404 | } |
405 | 405 | |
406 | 406 | /* |
407 | - * This is called from the generic Linux layer. | |
408 | - */ | |
409 | -void pcibios_update_irq(struct pci_dev *dev, int irq) | |
410 | -{ | |
411 | - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | |
412 | -} | |
413 | - | |
414 | -/* | |
415 | 407 | * Enable memory and/or address decoding, as appropriate, for the |
416 | 408 | * device described by the 'dev' struct. |
417 | 409 | * |
arch/tile/kernel/pci_gx.c
... | ... | @@ -1034,14 +1034,6 @@ |
1034 | 1034 | } |
1035 | 1035 | |
1036 | 1036 | /* |
1037 | - * This is called from the generic Linux layer. | |
1038 | - */ | |
1039 | -void pcibios_update_irq(struct pci_dev *dev, int irq) | |
1040 | -{ | |
1041 | - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | |
1042 | -} | |
1043 | - | |
1044 | -/* | |
1045 | 1037 | * Enable memory address decoding, as appropriate, for the |
1046 | 1038 | * device described by the 'dev' struct. The I/O decoding |
1047 | 1039 | * is disabled, though the TILE-Gx supports I/O addressing. |
arch/unicore32/kernel/pci.c
... | ... | @@ -154,14 +154,6 @@ |
154 | 154 | zhole_size[0] = 0; |
155 | 155 | } |
156 | 156 | |
157 | -void pcibios_update_irq(struct pci_dev *dev, int irq) | |
158 | -{ | |
159 | - if (debug_pci) | |
160 | - printk(KERN_DEBUG "PCI: Assigning IRQ %02d to %s\n", | |
161 | - irq, pci_name(dev)); | |
162 | - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | |
163 | -} | |
164 | - | |
165 | 157 | /* |
166 | 158 | * If the bus contains any of these devices, then we must not turn on |
167 | 159 | * parity checking of any kind. |
arch/x86/pci/visws.c
arch/xtensa/kernel/pci.c
... | ... | @@ -210,14 +210,6 @@ |
210 | 210 | /* No special bus mastering setup handling */ |
211 | 211 | } |
212 | 212 | |
213 | -/* the next one is stolen from the alpha port... */ | |
214 | - | |
215 | -void | |
216 | -pcibios_update_irq(struct pci_dev *dev, int irq) | |
217 | -{ | |
218 | - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | |
219 | -} | |
220 | - | |
221 | 213 | int pcibios_enable_device(struct pci_dev *dev, int mask) |
222 | 214 | { |
223 | 215 | u16 cmd, old_cmd; |
drivers/pci/setup-irq.c
... | ... | @@ -17,6 +17,11 @@ |
17 | 17 | #include <linux/ioport.h> |
18 | 18 | #include <linux/cache.h> |
19 | 19 | |
20 | +void __weak pcibios_update_irq(struct pci_dev *dev, int irq) | |
21 | +{ | |
22 | + dev_dbg(&dev->dev, "assigning IRQ %02d\n", irq); | |
23 | + pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | |
24 | +} | |
20 | 25 | |
21 | 26 | static void |
22 | 27 | pdev_fixup_irq(struct pci_dev *dev, |