Commit 1be9baa0 authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Jesse Barnes
Browse files

PCI: alpha: use generic pci_swizzle_interrupt_pin()



Use the generic pci_swizzle_interrupt_pin() instead of arch-specific code.

Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent 3f9455d4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -328,7 +328,7 @@ common_swizzle(struct pci_dev *dev, u8 *pinp)
	u8 pin = *pinp;

	while (dev->bus->parent) {
		pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn));
		pin = pci_swizzle_interrupt_pin(dev, pin);
		/* Move up the chain of bridges. */
		dev = dev->bus->self;
        }
+2 −7
Original line number Diff line number Diff line
@@ -106,16 +106,11 @@ struct pci_iommu_arena;
 *   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.  The routine
 *   pci_swizzle_interrupt_pin() swizzles for exactly one bridge.  The routine
 *   common_swizzle below handles multiple bridges.  But there are a
 *   couple boards that do strange things, so we define this here.
 *   couple boards that do strange things.
 */

static inline u8 bridge_swizzle(u8 pin, u8 slot) 
{
	return (((pin-1) + slot) % 4) + 1;
}


/* The following macro is used to implement the table-based irq mapping
   function for all single-bus Alphas.  */
+1 −1
Original line number Diff line number Diff line
@@ -481,7 +481,7 @@ monet_swizzle(struct pci_dev *dev, u8 *pinp)
				slot = PCI_SLOT(dev->devfn);
				break;
			}
			pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn)) ;
			pin = pci_swizzle_interrupt_pin(dev, pin);

			/* Move up the chain of bridges.  */
			dev = dev->bus->self;
+1 −1
Original line number Diff line number Diff line
@@ -204,7 +204,7 @@ eiger_swizzle(struct pci_dev *dev, u8 *pinp)
			break;
		}
		/* Must be a card-based bridge.  */
		pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn));
		pin = pci_swizzle_interrupt_pin(dev, pin);

		/* Move up the chain of bridges.  */
		dev = dev->bus->self;
+1 −1
Original line number Diff line number Diff line
@@ -219,7 +219,7 @@ miata_swizzle(struct pci_dev *dev, u8 *pinp)
				slot = PCI_SLOT(dev->devfn) + 9;
				break;
			}
			pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn));
			pin = pci_swizzle_interrupt_pin(dev, pin);

			/* Move up the chain of bridges.  */
			dev = dev->bus->self;
Loading