ARM: PCI: integrator: use common PCI swizzle
authorRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 10 Mar 2012 11:30:46 +0000 (11:30 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 13 May 2012 16:11:56 +0000 (17:11 +0100)
The Integrator swizzle function is almost the same as the standard PCI
swizzle, except for an initial check for pin = 0.  Make the integrator
swizzle function a wrapper around the standard PCI swizzle function so
we preseve this behaviour while using common code.

[fix to use pci_std_swizzle from Linus Walleij]

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-integrator/pci.c

index f1ca9c122861ba468ec2bc507a2e7a48050d15aa..f304deac8d05c4ec557557bf3b5646c15bcc40f7 100644 (file)
  */
 static u8 __init integrator_swizzle(struct pci_dev *dev, u8 *pinp)
 {
-       int pin = *pinp;
+       if (*pinp == 0)
+               *pinp = 1;
 
-       if (pin == 0)
-               pin = 1;
-
-       while (dev->bus->self) {
-               pin = pci_swizzle_interrupt_pin(dev, pin);
-               /*
-                * move up the chain of bridges, swizzling as we go.
-                */
-               dev = dev->bus->self;
-       }
-       *pinp = pin;
-
-       return PCI_SLOT(dev->devfn);
+       return pci_common_swizzle(dev, pinp);
 }
 
 static int irq_tab[4] __initdata = {