From: Bjorn Helgaas Date: Tue, 9 Dec 2008 23:12:12 +0000 (-0700) Subject: PCI: arm: use generic pci_swizzle_interrupt_pin() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f14d766a1a438fdc69d04b876965d6b26b071f14;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git PCI: arm: use generic pci_swizzle_interrupt_pin() Use the generic pci_swizzle_interrupt_pin() instead of arch-specific code. Cc: Russell King Signed-off-by: Bjorn Helgaas Signed-off-by: Jesse Barnes --- 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); */ u8 __devinit pci_std_swizzle(struct pci_dev *dev, u8 *pinp) { - int pin = *pinp - 1; + int pin = *pinp; while (dev->bus->self) { - pin = (pin + PCI_SLOT(dev->devfn)) & 3; + pin = pci_swizzle_interrupt_pin(dev, pin); /* * move up the chain of bridges, * swizzling as we go. */ dev = dev->bus->self; } - *pinp = pin + 1; + *pinp = pin; return PCI_SLOT(dev->devfn); } 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 @@ * * Where A = pin 1, B = pin 2 and so on and pin=0 = default = A. * Thus, each swizzle is ((pin-1) + (device#-4)) % 4 - * - * The following code swizzles for exactly one bridge. */ -static inline int bridge_swizzle(int pin, unsigned int slot) -{ - return (pin + slot) & 3; -} /* * This routine handles multiple bridges. @@ -81,15 +75,14 @@ static u8 __init integrator_swizzle(struct pci_dev *dev, u8 *pinp) if (pin == 0) pin = 1; - pin -= 1; while (dev->bus->self) { - pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn)); + pin = pci_swizzle_interrupt_pin(dev, pin); /* * move up the chain of bridges, swizzling as we go. */ dev = dev->bus->self; } - *pinp = pin + 1; + *pinp = pin; return PCI_SLOT(dev->devfn); }