Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 59184
b: refs/heads/master
c: 5463d9f
h: refs/heads/master
v: v3
  • Loading branch information
Randy Dunlap authored and Greg Kroah-Hartman committed Jul 11, 2007
1 parent d0cf9ed commit d3ad87b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 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: 0bbd6424c55f0ab9e7fcd6a851bc49e265259ff5
refs/heads/master: 5463d9f0f323123d96989d318ac9c537158ad0a5
7 changes: 5 additions & 2 deletions trunk/drivers/pci/search.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,14 @@ struct pci_dev * pci_get_slot(struct pci_bus *bus, unsigned int devfn)
}

/**
* pci_get_bus_and_slot - locate PCI device from a given PCI slot
* pci_get_bus_and_slot - locate PCI device from a given PCI bus & slot
* @bus: number of PCI bus on which desired PCI device resides
* @devfn: encodes number of PCI slot in which the desired PCI
* device resides and the logical device number within that slot
* in case of multi-function devices.
*
* Note: the bus/slot search is limited to PCI domain (segment) 0.
*
* Given a PCI bus and slot/function number, the desired PCI device
* is located in system global list of PCI devices. If the device
* is found, a pointer to its data structure is returned. If no
Expand All @@ -157,7 +159,8 @@ struct pci_dev * pci_get_bus_and_slot(unsigned int bus, unsigned int devfn)
struct pci_dev *dev = NULL;

while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
if (dev->bus->number == bus && dev->devfn == devfn)
if (pci_domain_nr(dev->bus) == 0 &&
(dev->bus->number == bus && dev->devfn == devfn))
return dev;
}
return NULL;
Expand Down

0 comments on commit d3ad87b

Please sign in to comment.