aboutsummaryrefslogtreecommitdiff
path: root/drivers/pci/setup-irq.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-19 12:59:55 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-19 12:59:55 -0800
commit733abe4fff3afa13e301bc8bc5bee9aac4b59fdc (patch)
treec11f08a401783848deb7f41f65e990333971ba66 /drivers/pci/setup-irq.c
parent5fe8252fc3a21666cf19053fbd7ec7bd9664f5d9 (diff)
parent81bb0e198b4638ac65233b316f4588639dfe1fcd (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6: PCI: Make PCI device numa-node attribute visible in sysfs PCI: add systems for automatic breadth-first device sorting PCI: PCI devices get assigned redundant IRQs PCI: Make CARDBUS_MEM_SIZE and CARDBUS_IO_SIZE boot options PCI: pci.txt fix __devexit() usage PCI/sysfs/kobject kernel-doc fixes
Diffstat (limited to 'drivers/pci/setup-irq.c')
-rw-r--r--drivers/pci/setup-irq.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/pci/setup-irq.c b/drivers/pci/setup-irq.c
index a251289c995..568f1877315 100644
--- a/drivers/pci/setup-irq.c
+++ b/drivers/pci/setup-irq.c
@@ -24,7 +24,7 @@ pdev_fixup_irq(struct pci_dev *dev,
int (*map_irq)(struct pci_dev *, u8, u8))
{
u8 pin, slot;
- int irq;
+ int irq = 0;
/* If this device is not on the primary bus, we need to figure out
which interrupt pin it will come in on. We know which slot it
@@ -33,16 +33,18 @@ pdev_fixup_irq(struct pci_dev *dev,
apply the swizzle function. */
pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
- /* Cope with 0 and illegal. */
- if (pin == 0 || pin > 4)
+ /* Cope with illegal. */
+ if (pin > 4)
pin = 1;
- /* Follow the chain of bridges, swizzling as we go. */
- slot = (*swizzle)(dev, &pin);
+ if (pin != 0) {
+ /* Follow the chain of bridges, swizzling as we go. */
+ slot = (*swizzle)(dev, &pin);
- irq = (*map_irq)(dev, slot, pin);
- if (irq == -1)
- irq = 0;
+ irq = (*map_irq)(dev, slot, pin);
+ if (irq == -1)
+ irq = 0;
+ }
dev->irq = irq;
pr_debug("PCI: fixup irq: (%s) got %d\n",