aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/pci/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/pci/pci.c')
-rw-r--r--arch/mips/pci/pci.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index 62cae740e250..b0eb9e75c682 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -149,28 +149,6 @@ out:
149 "Skipping PCI bus scan due to resource conflict\n"); 149 "Skipping PCI bus scan due to resource conflict\n");
150} 150}
151 151
152/* Most MIPS systems have straight-forward swizzling needs. */
153
154static inline u8 bridge_swizzle(u8 pin, u8 slot)
155{
156 return (((pin - 1) + slot) % 4) + 1;
157}
158
159static u8 __init common_swizzle(struct pci_dev *dev, u8 *pinp)
160{
161 u8 pin = *pinp;
162
163 while (dev->bus->parent) {
164 pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn));
165 /* Move up the chain of bridges. */
166 dev = dev->bus->self;
167 }
168 *pinp = pin;
169
170 /* The slot is the slot of the last bridge. */
171 return PCI_SLOT(dev->devfn);
172}
173
174static int __init pcibios_init(void) 152static int __init pcibios_init(void)
175{ 153{
176 struct pci_controller *hose; 154 struct pci_controller *hose;
@@ -179,7 +157,7 @@ static int __init pcibios_init(void)
179 for (hose = hose_head; hose; hose = hose->next) 157 for (hose = hose_head; hose; hose = hose->next)
180 pcibios_scanbus(hose); 158 pcibios_scanbus(hose);
181 159
182 pci_fixup_irqs(common_swizzle, pcibios_map_irq); 160 pci_fixup_irqs(pci_common_swizzle, pcibios_map_irq);
183 161
184 pci_initialized = 1; 162 pci_initialized = 1;
185 163