Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>

authored by

Bjorn Helgaas and committed by
Jesse Barnes
1be9baa0 3f9455d4

+9 -14
+1 -1
arch/alpha/kernel/pci.c
··· 328 328 u8 pin = *pinp; 329 329 330 330 while (dev->bus->parent) { 331 - pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn)); 331 + pin = pci_swizzle_interrupt_pin(dev, pin); 332 332 /* Move up the chain of bridges. */ 333 333 dev = dev->bus->self; 334 334 }
+2 -7
arch/alpha/kernel/pci_impl.h
··· 106 106 * Where A = pin 1, B = pin 2 and so on and pin=0 = default = A. 107 107 * Thus, each swizzle is ((pin-1) + (device#-4)) % 4 108 108 * 109 - * The following code swizzles for exactly one bridge. The routine 109 + * pci_swizzle_interrupt_pin() swizzles for exactly one bridge. The routine 110 110 * common_swizzle below handles multiple bridges. But there are a 111 - * couple boards that do strange things, so we define this here. 111 + * couple boards that do strange things. 112 112 */ 113 - 114 - static inline u8 bridge_swizzle(u8 pin, u8 slot) 115 - { 116 - return (((pin-1) + slot) % 4) + 1; 117 - } 118 113 119 114 120 115 /* The following macro is used to implement the table-based irq mapping
+1 -1
arch/alpha/kernel/sys_dp264.c
··· 481 481 slot = PCI_SLOT(dev->devfn); 482 482 break; 483 483 } 484 - pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn)) ; 484 + pin = pci_swizzle_interrupt_pin(dev, pin); 485 485 486 486 /* Move up the chain of bridges. */ 487 487 dev = dev->bus->self;
+1 -1
arch/alpha/kernel/sys_eiger.c
··· 204 204 break; 205 205 } 206 206 /* Must be a card-based bridge. */ 207 - pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn)); 207 + pin = pci_swizzle_interrupt_pin(dev, pin); 208 208 209 209 /* Move up the chain of bridges. */ 210 210 dev = dev->bus->self;
+1 -1
arch/alpha/kernel/sys_miata.c
··· 219 219 slot = PCI_SLOT(dev->devfn) + 9; 220 220 break; 221 221 } 222 - pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn)); 222 + pin = pci_swizzle_interrupt_pin(dev, pin); 223 223 224 224 /* Move up the chain of bridges. */ 225 225 dev = dev->bus->self;
+1 -1
arch/alpha/kernel/sys_noritake.c
··· 257 257 slot = PCI_SLOT(dev->devfn) + 15; 258 258 break; 259 259 } 260 - pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn)) ; 260 + pin = pci_swizzle_interrupt_pin(dev, pin); 261 261 262 262 /* Move up the chain of bridges. */ 263 263 dev = dev->bus->self;
+1 -1
arch/alpha/kernel/sys_ruffian.c
··· 160 160 slot = PCI_SLOT(dev->devfn) + 10; 161 161 break; 162 162 } 163 - pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn)); 163 + pin = pci_swizzle_interrupt_pin(dev, pin); 164 164 165 165 /* Move up the chain of bridges. */ 166 166 dev = dev->bus->self;
+1 -1
arch/alpha/kernel/sys_sable.c
··· 425 425 slot = PCI_SLOT(dev->devfn) + 11; 426 426 break; 427 427 } 428 - pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn)) ; 428 + pin = pci_swizzle_interrupt_pin(dev, pin); 429 429 430 430 /* Move up the chain of bridges. */ 431 431 dev = dev->bus->self;