Skip to content

Commit

Permalink
PCI: x86: use generic pci_swizzle_interrupt_pin()
Browse files Browse the repository at this point in the history
Use the generic pci_swizzle_interrupt_pin() instead of arch-specific code.

Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: [email protected]
Signed-off-by: Bjorn Helgaas <[email protected]>
Signed-off-by: Jesse Barnes <[email protected]>
  • Loading branch information
Bjorn Helgaas authored and jbarnes993 committed Jan 7, 2009
1 parent 1be9baa commit b1c8679
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions arch/x86/pci/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ static void __init pcibios_fixup_irqs(void)
struct pci_dev *bridge = dev->bus->self;
int bus;

pin = (((pin - 1) + PCI_SLOT(dev->devfn)) % 4) + 1;
pin = pci_swizzle_interrupt_pin(dev, pin);
bus = bridge->bus->number;
irq = IO_APIC_get_PCI_irq_vector(bus,
PCI_SLOT(bridge->devfn), pin - 1);
Expand Down Expand Up @@ -1232,7 +1232,7 @@ static int pirq_enable_irq(struct pci_dev *dev)
while (irq < 0 && dev->bus->parent) { /* go back to the bridge */
struct pci_dev *bridge = dev->bus->self;

pin = (((pin - 1) + PCI_SLOT(dev->devfn)) % 4) + 1;
pin = pci_swizzle_interrupt_pin(dev, pin);
irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number,
PCI_SLOT(bridge->devfn), pin - 1);
if (irq >= 0)
Expand Down
7 changes: 1 addition & 6 deletions arch/x86/pci/visws.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,12 @@ static void pci_visws_disable_irq(struct pci_dev *dev) { }

unsigned int pci_bus0, pci_bus1;

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

static u8 __init visws_swizzle(struct pci_dev *dev, u8 *pinp)
{
u8 pin = *pinp;

while (dev->bus->self) { /* Move up the chain of bridges. */
pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn));
pin = pci_swizzle_interrupt_pin(dev, pin);
dev = dev->bus->self;
}
*pinp = pin;
Expand Down

0 comments on commit b1c8679

Please sign in to comment.