Commit 6aa6e498 authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Jesse Barnes

PCI: sh: use generic pci_swizzle_interrupt_pin()

Use the generic pci_swizzle_interrupt_pin() instead of arch-specific code.
Acked-by: default avatarPaul Mundt <lethal@linux-sh.org>
Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent f14d766a
...@@ -5,11 +5,6 @@ ...@@ -5,11 +5,6 @@
#include <cpu/irq.h> #include <cpu/irq.h>
#include "pci-sh5.h" #include "pci-sh5.h"
static inline u8 bridge_swizzle(u8 pin, u8 slot)
{
return (((pin - 1) + slot) % 4) + 1;
}
int __init pcibios_map_platform_irq(struct pci_dev *dev, u8 slot, u8 pin) int __init pcibios_map_platform_irq(struct pci_dev *dev, u8 slot, u8 pin)
{ {
int result = -1; int result = -1;
...@@ -42,7 +37,7 @@ int __init pcibios_map_platform_irq(struct pci_dev *dev, u8 slot, u8 pin) ...@@ -42,7 +37,7 @@ int __init pcibios_map_platform_irq(struct pci_dev *dev, u8 slot, u8 pin)
while (dev->bus->number > 0) { while (dev->bus->number > 0) {
slot = path[i].slot = PCI_SLOT(dev->devfn); slot = path[i].slot = PCI_SLOT(dev->devfn);
pin = path[i].pin = bridge_swizzle(pin, slot); pin = path[i].pin = pci_swizzle_interrupt_pin(dev, pin);
dev = dev->bus->self; dev = dev->bus->self;
i++; i++;
if (i > 3) panic("PCI path to root bus too long!\n"); if (i > 3) panic("PCI path to root bus too long!\n");
...@@ -56,7 +51,7 @@ int __init pcibios_map_platform_irq(struct pci_dev *dev, u8 slot, u8 pin) ...@@ -56,7 +51,7 @@ int __init pcibios_map_platform_irq(struct pci_dev *dev, u8 slot, u8 pin)
if ((slot < 3) || (i == 0)) { if ((slot < 3) || (i == 0)) {
/* Bus 0 (incl. PCI-PCI bridge itself) : perform the final /* Bus 0 (incl. PCI-PCI bridge itself) : perform the final
swizzle now. */ swizzle now. */
result = IRQ_INTA + bridge_swizzle(pin, slot) - 1; result = IRQ_INTA + pci_swizzle_interrupt_pin(dev, pin) - 1;
} else { } else {
i--; i--;
slot = path[i].slot; slot = path[i].slot;
......
...@@ -21,17 +21,12 @@ ...@@ -21,17 +21,12 @@
#include <linux/init.h> #include <linux/init.h>
#include <asm/io.h> #include <asm/io.h>
static inline u8 bridge_swizzle(u8 pin, u8 slot)
{
return (((pin - 1) + slot) % 4) + 1;
}
static u8 __init simple_swizzle(struct pci_dev *dev, u8 *pinp) static u8 __init simple_swizzle(struct pci_dev *dev, u8 *pinp)
{ {
u8 pin = *pinp; u8 pin = *pinp;
while (dev->bus->parent) { 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. */ /* Move up the chain of bridges. */
dev = dev->bus->self; dev = dev->bus->self;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment