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

Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
arch/alpha/kernel/pci.c
arch/alpha/kernel/pci_impl.h
arch/alpha/kernel/sys_dp264.c
arch/alpha/kernel/sys_eiger.c
arch/alpha/kernel/sys_miata.c
arch/alpha/kernel/sys_noritake.c
arch/alpha/kernel/sys_ruffian.c
arch/alpha/kernel/sys_sable.c

index ff8cb638472e54cfbcb298cefb536cdfcfa0dd03..b03d9f42042584baf38520ab353ea6215b2622c8 100644 (file)
@@ -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;
         }
index f8b74995a0022d5b6f0148099bc0cfa86ca18c87..7336651592a349500cd00de289d961944d5e05c8 100644 (file)
@@ -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.  */
index ab44c164d9d47e95ae80d84bd96fd39b9cf927a9..9c9d1fd4155fc5e736c98d89e68d034cd8f2b9ef 100644 (file)
@@ -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;
index 7ef3b6fb3700c877309e3100c0d9991de7659b44..baf60f36cbd773114f5d8e69a151b03d98608986 100644 (file)
@@ -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;
index 910b43cd63e830b7f1a8664b3a4833b1a81e2e8e..61ccd95579ecdbde1799d62c7d1c7b3ee515ba24 100644 (file)
@@ -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;
index eb2a1d63f484e6ff4ff283bd2152493fa87d2d40..538876b62449a215034d053036f3e0e114e51dd4 100644 (file)
@@ -257,7 +257,7 @@ noritake_swizzle(struct pci_dev *dev, u8 *pinp)
                                slot = PCI_SLOT(dev->devfn) + 15;
                                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;
index 5b99cf3cd69cb3be72cf733d10f14885feb74f66..f15a329b6011167791b6baf2f898de662a5fb1d1 100644 (file)
@@ -160,7 +160,7 @@ ruffian_swizzle(struct pci_dev *dev, u8 *pinp)
                                slot = PCI_SLOT(dev->devfn) + 10;
                                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;
index a4555f497639fa0c68e7da3e0284ce221005cee9..d232e42be018ba13cf61522377785c4e5947ec28 100644 (file)
@@ -425,7 +425,7 @@ lynx_swizzle(struct pci_dev *dev, u8 *pinp)
                                slot = PCI_SLOT(dev->devfn) + 11;
                                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;