diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2008-12-09 18:12:07 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-01-07 14:12:53 -0500 |
commit | 1be9baa09340bbe3329aab3bd0d41076f59c8f22 (patch) | |
tree | 5a2aed70b85e6149b2ec53085513a2f9cfc4eb86 /arch/alpha/kernel | |
parent | 3f9455d488ca97f68a1c99c7473c26030261b713 (diff) |
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>
Diffstat (limited to 'arch/alpha/kernel')
-rw-r--r-- | arch/alpha/kernel/pci.c | 2 | ||||
-rw-r--r-- | arch/alpha/kernel/pci_impl.h | 9 | ||||
-rw-r--r-- | arch/alpha/kernel/sys_dp264.c | 2 | ||||
-rw-r--r-- | arch/alpha/kernel/sys_eiger.c | 2 | ||||
-rw-r--r-- | arch/alpha/kernel/sys_miata.c | 2 | ||||
-rw-r--r-- | arch/alpha/kernel/sys_noritake.c | 2 | ||||
-rw-r--r-- | arch/alpha/kernel/sys_ruffian.c | 2 | ||||
-rw-r--r-- | arch/alpha/kernel/sys_sable.c | 2 |
8 files changed, 9 insertions, 14 deletions
diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c index ff8cb638472e..b03d9f420425 100644 --- a/arch/alpha/kernel/pci.c +++ b/arch/alpha/kernel/pci.c | |||
@@ -328,7 +328,7 @@ common_swizzle(struct pci_dev *dev, u8 *pinp) | |||
328 | u8 pin = *pinp; | 328 | u8 pin = *pinp; |
329 | 329 | ||
330 | while (dev->bus->parent) { | 330 | while (dev->bus->parent) { |
331 | pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn)); | 331 | pin = pci_swizzle_interrupt_pin(dev, pin); |
332 | /* Move up the chain of bridges. */ | 332 | /* Move up the chain of bridges. */ |
333 | dev = dev->bus->self; | 333 | dev = dev->bus->self; |
334 | } | 334 | } |
diff --git a/arch/alpha/kernel/pci_impl.h b/arch/alpha/kernel/pci_impl.h index f8b74995a002..7336651592a3 100644 --- a/arch/alpha/kernel/pci_impl.h +++ b/arch/alpha/kernel/pci_impl.h | |||
@@ -106,16 +106,11 @@ struct pci_iommu_arena; | |||
106 | * Where A = pin 1, B = pin 2 and so on and pin=0 = default = A. | 106 | * Where A = pin 1, B = pin 2 and so on and pin=0 = default = A. |
107 | * Thus, each swizzle is ((pin-1) + (device#-4)) % 4 | 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 | * common_swizzle below handles multiple bridges. But there are a | 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 | 113 | ||
114 | static inline u8 bridge_swizzle(u8 pin, u8 slot) | ||
115 | { | ||
116 | return (((pin-1) + slot) % 4) + 1; | ||
117 | } | ||
118 | |||
119 | 114 | ||
120 | /* The following macro is used to implement the table-based irq mapping | 115 | /* The following macro is used to implement the table-based irq mapping |
121 | function for all single-bus Alphas. */ | 116 | function for all single-bus Alphas. */ |
diff --git a/arch/alpha/kernel/sys_dp264.c b/arch/alpha/kernel/sys_dp264.c index ab44c164d9d4..9c9d1fd4155f 100644 --- a/arch/alpha/kernel/sys_dp264.c +++ b/arch/alpha/kernel/sys_dp264.c | |||
@@ -481,7 +481,7 @@ monet_swizzle(struct pci_dev *dev, u8 *pinp) | |||
481 | slot = PCI_SLOT(dev->devfn); | 481 | slot = PCI_SLOT(dev->devfn); |
482 | break; | 482 | break; |
483 | } | 483 | } |
484 | pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn)) ; | 484 | pin = pci_swizzle_interrupt_pin(dev, pin); |
485 | 485 | ||
486 | /* Move up the chain of bridges. */ | 486 | /* Move up the chain of bridges. */ |
487 | dev = dev->bus->self; | 487 | dev = dev->bus->self; |
diff --git a/arch/alpha/kernel/sys_eiger.c b/arch/alpha/kernel/sys_eiger.c index 7ef3b6fb3700..baf60f36cbd7 100644 --- a/arch/alpha/kernel/sys_eiger.c +++ b/arch/alpha/kernel/sys_eiger.c | |||
@@ -204,7 +204,7 @@ eiger_swizzle(struct pci_dev *dev, u8 *pinp) | |||
204 | break; | 204 | break; |
205 | } | 205 | } |
206 | /* Must be a card-based bridge. */ | 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 | /* Move up the chain of bridges. */ | 209 | /* Move up the chain of bridges. */ |
210 | dev = dev->bus->self; | 210 | dev = dev->bus->self; |
diff --git a/arch/alpha/kernel/sys_miata.c b/arch/alpha/kernel/sys_miata.c index 910b43cd63e8..61ccd95579ec 100644 --- a/arch/alpha/kernel/sys_miata.c +++ b/arch/alpha/kernel/sys_miata.c | |||
@@ -219,7 +219,7 @@ miata_swizzle(struct pci_dev *dev, u8 *pinp) | |||
219 | slot = PCI_SLOT(dev->devfn) + 9; | 219 | slot = PCI_SLOT(dev->devfn) + 9; |
220 | break; | 220 | break; |
221 | } | 221 | } |
222 | pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn)); | 222 | pin = pci_swizzle_interrupt_pin(dev, pin); |
223 | 223 | ||
224 | /* Move up the chain of bridges. */ | 224 | /* Move up the chain of bridges. */ |
225 | dev = dev->bus->self; | 225 | dev = dev->bus->self; |
diff --git a/arch/alpha/kernel/sys_noritake.c b/arch/alpha/kernel/sys_noritake.c index eb2a1d63f484..538876b62449 100644 --- a/arch/alpha/kernel/sys_noritake.c +++ b/arch/alpha/kernel/sys_noritake.c | |||
@@ -257,7 +257,7 @@ noritake_swizzle(struct pci_dev *dev, u8 *pinp) | |||
257 | slot = PCI_SLOT(dev->devfn) + 15; | 257 | slot = PCI_SLOT(dev->devfn) + 15; |
258 | break; | 258 | break; |
259 | } | 259 | } |
260 | pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn)) ; | 260 | pin = pci_swizzle_interrupt_pin(dev, pin); |
261 | 261 | ||
262 | /* Move up the chain of bridges. */ | 262 | /* Move up the chain of bridges. */ |
263 | dev = dev->bus->self; | 263 | dev = dev->bus->self; |
diff --git a/arch/alpha/kernel/sys_ruffian.c b/arch/alpha/kernel/sys_ruffian.c index 5b99cf3cd69c..f15a329b6011 100644 --- a/arch/alpha/kernel/sys_ruffian.c +++ b/arch/alpha/kernel/sys_ruffian.c | |||
@@ -160,7 +160,7 @@ ruffian_swizzle(struct pci_dev *dev, u8 *pinp) | |||
160 | slot = PCI_SLOT(dev->devfn) + 10; | 160 | slot = PCI_SLOT(dev->devfn) + 10; |
161 | break; | 161 | break; |
162 | } | 162 | } |
163 | pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn)); | 163 | pin = pci_swizzle_interrupt_pin(dev, pin); |
164 | 164 | ||
165 | /* Move up the chain of bridges. */ | 165 | /* Move up the chain of bridges. */ |
166 | dev = dev->bus->self; | 166 | dev = dev->bus->self; |
diff --git a/arch/alpha/kernel/sys_sable.c b/arch/alpha/kernel/sys_sable.c index a4555f497639..d232e42be018 100644 --- a/arch/alpha/kernel/sys_sable.c +++ b/arch/alpha/kernel/sys_sable.c | |||
@@ -425,7 +425,7 @@ lynx_swizzle(struct pci_dev *dev, u8 *pinp) | |||
425 | slot = PCI_SLOT(dev->devfn) + 11; | 425 | slot = PCI_SLOT(dev->devfn) + 11; |
426 | break; | 426 | break; |
427 | } | 427 | } |
428 | pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn)) ; | 428 | pin = pci_swizzle_interrupt_pin(dev, pin); |
429 | 429 | ||
430 | /* Move up the chain of bridges. */ | 430 | /* Move up the chain of bridges. */ |
431 | dev = dev->bus->self; | 431 | dev = dev->bus->self; |