PCI: parisc: use generic pci_swizzle_interrupt_pin()
authorBjorn Helgaas <bjorn.helgaas@hp.com>
Tue, 9 Dec 2008 23:12:22 +0000 (16:12 -0700)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Wed, 7 Jan 2009 19:12:55 +0000 (11:12 -0800)
Use the generic pci_swizzle_interrupt_pin() instead of arch-specific code.

Acked-by: Kyle McMartin <kyle@infradead.org>
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/parisc/dino.c
drivers/parisc/iosapic.c

index 3bc54b30c3a18af9733718015e5370b7a3a79038..77cc8bfef8c9aca1bf9eb141db38fa3626588675 100644 (file)
@@ -547,7 +547,7 @@ dino_card_fixup(struct pci_dev *dev)
        ** The additional "-1" adjusts for skewing the IRQ<->slot.
        */
        dino_cfg_read(dev->bus, dev->devfn, PCI_INTERRUPT_PIN, 1, &irq_pin); 
-       dev->irq = (irq_pin + PCI_SLOT(dev->devfn) - 1) % 4 ;
+       dev->irq = pci_swizzle_interrupt_pin(dev, irq_pin) - 1;
 
        /* Shouldn't really need to do this but it's in case someone tries
        ** to bypass PCI services and look at the card themselves.
@@ -672,7 +672,7 @@ dino_fixup_bus(struct pci_bus *bus)
                        
                        dino_cfg_read(dev->bus, dev->devfn, 
                                      PCI_INTERRUPT_PIN, 1, &irq_pin);
-                       irq_pin = (irq_pin + PCI_SLOT(dev->devfn) - 1) % 4 ;
+                       irq_pin = pci_swizzle_interrupt_pin(dev, irq_pin) - 1;
                        printk(KERN_WARNING "Device %s has undefined IRQ, "
                                        "setting to %d\n", pci_name(dev), irq_pin);
                        dino_cfg_write(dev->bus, dev->devfn, 
index 9dedbbd218c3967932a83f866d5338034f664457..0797659ee0169b735f2f304b141437e7835c8c34 100644 (file)
@@ -519,8 +519,7 @@ iosapic_xlate_pin(struct iosapic_info *isi, struct pci_dev *pcidev)
                **
                ** Advantage is it's really easy to implement.
                */
-               intr_pin = ((intr_pin-1)+PCI_SLOT(pcidev->devfn)) % 4;
-               intr_pin++;     /* convert back to INTA-D (1-4) */
+               intr_pin = pci_swizzle_interrupt_pin(pcidev, intr_pin);
 #endif /* PCI_BRIDGE_FUNCS */
 
                /*