aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2008-12-09 18:12:12 -0500
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-01-07 14:12:51 -0500
commitf14d766a1a438fdc69d04b876965d6b26b071f14 (patch)
tree065355677f2d249fb838b6eb495f379b647698a0 /arch/arm
parent57c2cf71c12318b72ebaa5720d210476b6bac4d4 (diff)
PCI: arm: use generic pci_swizzle_interrupt_pin()
Use the generic pci_swizzle_interrupt_pin() instead of arch-specific code. Cc: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/kernel/bios32.c6
-rw-r--r--arch/arm/mach-integrator/pci.c11
2 files changed, 5 insertions, 12 deletions
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index 17a59b6e521f..5c5a0bc06709 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -491,17 +491,17 @@ EXPORT_SYMBOL(pcibios_bus_to_resource);
491 */ 491 */
492u8 __devinit pci_std_swizzle(struct pci_dev *dev, u8 *pinp) 492u8 __devinit pci_std_swizzle(struct pci_dev *dev, u8 *pinp)
493{ 493{
494 int pin = *pinp - 1; 494 int pin = *pinp;
495 495
496 while (dev->bus->self) { 496 while (dev->bus->self) {
497 pin = (pin + PCI_SLOT(dev->devfn)) & 3; 497 pin = pci_swizzle_interrupt_pin(dev, pin);
498 /* 498 /*
499 * move up the chain of bridges, 499 * move up the chain of bridges,
500 * swizzling as we go. 500 * swizzling as we go.
501 */ 501 */
502 dev = dev->bus->self; 502 dev = dev->bus->self;
503 } 503 }
504 *pinp = pin + 1; 504 *pinp = pin;
505 505
506 return PCI_SLOT(dev->devfn); 506 return PCI_SLOT(dev->devfn);
507} 507}
diff --git a/arch/arm/mach-integrator/pci.c b/arch/arm/mach-integrator/pci.c
index af7d3ff013ec..2fdb95433f0a 100644
--- a/arch/arm/mach-integrator/pci.c
+++ b/arch/arm/mach-integrator/pci.c
@@ -63,13 +63,7 @@
63 * 63 *
64 * Where A = pin 1, B = pin 2 and so on and pin=0 = default = A. 64 * Where A = pin 1, B = pin 2 and so on and pin=0 = default = A.
65 * Thus, each swizzle is ((pin-1) + (device#-4)) % 4 65 * Thus, each swizzle is ((pin-1) + (device#-4)) % 4
66 *
67 * The following code swizzles for exactly one bridge.
68 */ 66 */
69static inline int bridge_swizzle(int pin, unsigned int slot)
70{
71 return (pin + slot) & 3;
72}
73 67
74/* 68/*
75 * This routine handles multiple bridges. 69 * This routine handles multiple bridges.
@@ -81,15 +75,14 @@ static u8 __init integrator_swizzle(struct pci_dev *dev, u8 *pinp)
81 if (pin == 0) 75 if (pin == 0)
82 pin = 1; 76 pin = 1;
83 77
84 pin -= 1;
85 while (dev->bus->self) { 78 while (dev->bus->self) {
86 pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn)); 79 pin = pci_swizzle_interrupt_pin(dev, pin);
87 /* 80 /*
88 * move up the chain of bridges, swizzling as we go. 81 * move up the chain of bridges, swizzling as we go.
89 */ 82 */
90 dev = dev->bus->self; 83 dev = dev->bus->self;
91 } 84 }
92 *pinp = pin + 1; 85 *pinp = pin;
93 86
94 return PCI_SLOT(dev->devfn); 87 return PCI_SLOT(dev->devfn);
95} 88}