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

PCI: alpha: use generic INTx swizzle from PCI core

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

Note that pci_common_swizzle() loops based on dev->bus->self, not
dev->bus->parent as the alpha common_swizzle() did. I think they
are equivalent for this purpose.

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
3e08601f 68feac87

+2 -20
-18
arch/alpha/kernel/pci.c
··· 320 320 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); 321 321 } 322 322 323 - /* Most Alphas have straight-forward swizzling needs. */ 324 - 325 - u8 __init 326 - common_swizzle(struct pci_dev *dev, u8 *pinp) 327 - { 328 - u8 pin = *pinp; 329 - 330 - while (dev->bus->parent) { 331 - pin = pci_swizzle_interrupt_pin(dev, pin); 332 - /* Move up the chain of bridges. */ 333 - dev = dev->bus->self; 334 - } 335 - *pinp = pin; 336 - 337 - /* The slot is the slot of the last bridge. */ 338 - return PCI_SLOT(dev->devfn); 339 - } 340 - 341 323 void 342 324 pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, 343 325 struct resource *res)
+2 -2
arch/alpha/kernel/pci_impl.h
··· 107 107 * Thus, each swizzle is ((pin-1) + (device#-4)) % 4 108 108 * 109 109 * pci_swizzle_interrupt_pin() swizzles for exactly one bridge. The routine 110 - * common_swizzle below handles multiple bridges. But there are a 110 + * pci_common_swizzle() handles multiple bridges. But there are a 111 111 * couple boards that do strange things. 112 112 */ 113 113 ··· 179 179 extern unsigned long alpha_agpgart_size; 180 180 181 181 extern void common_init_pci(void); 182 - extern u8 common_swizzle(struct pci_dev *, u8 *); 182 + #define common_swizzle pci_common_swizzle 183 183 extern struct pci_controller *alloc_pci_controller(void); 184 184 extern struct resource *alloc_resource(void); 185 185