summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk@flint.arm.linux.org.uk>2003-03-16 21:33:30 +0000
committerRussell King <rmk@flint.arm.linux.org.uk>2003-03-16 21:33:30 +0000
commita9d96a6e1f57deea016cdf580d1fdee2ecef6df8 (patch)
treee2309b25a1af509be35377fa5865590ea2c0bc59
parentbda2dabecfce94ecbcf155e7a4563b1004933100 (diff)
[PCI] pci-6 - Fix scanning of non-zero functions
Fix breakage in pci-3 - we scanned all functions if function 0 was not present. This causes some host bridges to lock up when scanning devfn 255 on PPC machines.
-rw-r--r--drivers/pci/probe.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 1c66d319f420..2715583870db 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -520,11 +520,14 @@ int __devinit pci_scan_slot(struct pci_bus *bus, int devfn)
struct pci_dev *dev;
dev = pci_scan_device(bus, devfn);
- if (!dev)
- continue;
-
- if (func != 0)
+ if (func == 0) {
+ if (!dev)
+ break;
+ } else {
+ if (!dev)
+ continue;
dev->multifunction = 1;
+ }
/* Fix up broken headers */
pci_fixup_device(PCI_FIXUP_HEADER, dev);