Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 180971
b: refs/heads/master
c: 4fb88c1
h: refs/heads/master
i:
  180969: d4f49c4
  180967: 87b0b99
v: v3
  • Loading branch information
Matthew Wilcox authored and Jesse Barnes committed Feb 23, 2010
1 parent 31a0446 commit 1ceac07
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0bf01c3c86d4b9ea279d6215420484db887f5db5
refs/heads/master: 4fb88c1a28a8dc302bdc09858e7cdafc97bef794
18 changes: 14 additions & 4 deletions trunk/drivers/pci/probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1222,11 +1222,19 @@ EXPORT_SYMBOL(pci_scan_single_device);
static unsigned next_ari_fn(struct pci_dev *dev, unsigned fn)
{
u16 cap;
unsigned pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ARI);
unsigned pos, next_fn;

if (!dev)
return 0;

pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ARI);
if (!pos)
return 0;
pci_read_config_word(dev, pos + 4, &cap);
return cap >> 8;
next_fn = cap >> 8;
if (next_fn <= fn)
return 0;
return next_fn;
}

static unsigned next_trad_fn(struct pci_dev *dev, unsigned fn)
Expand Down Expand Up @@ -1271,12 +1279,14 @@ int pci_scan_slot(struct pci_bus *bus, int devfn)
return 0; /* Already scanned the entire slot */

dev = pci_scan_single_device(bus, devfn);
if (dev && !dev->is_added) /* new device? */
if (!dev)
return 0;
if (!dev->is_added)
nr++;

if (pci_ari_enabled(bus))
next_fn = next_ari_fn;
else if (dev && dev->multifunction)
else if (dev->multifunction)
next_fn = next_trad_fn;

for (fn = next_fn(dev, 0); fn > 0; fn = next_fn(dev, fn)) {
Expand Down

0 comments on commit 1ceac07

Please sign in to comment.