diff options
Diffstat (limited to 'drivers/pci/search.c')
-rw-r--r-- | drivers/pci/search.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/pci/search.c b/drivers/pci/search.c index c13232435dc0..9f7090fa8771 100644 --- a/drivers/pci/search.c +++ b/drivers/pci/search.c | |||
@@ -139,12 +139,14 @@ struct pci_dev * pci_get_slot(struct pci_bus *bus, unsigned int devfn) | |||
139 | } | 139 | } |
140 | 140 | ||
141 | /** | 141 | /** |
142 | * pci_get_bus_and_slot - locate PCI device from a given PCI slot | 142 | * pci_get_bus_and_slot - locate PCI device from a given PCI bus & slot |
143 | * @bus: number of PCI bus on which desired PCI device resides | 143 | * @bus: number of PCI bus on which desired PCI device resides |
144 | * @devfn: encodes number of PCI slot in which the desired PCI | 144 | * @devfn: encodes number of PCI slot in which the desired PCI |
145 | * device resides and the logical device number within that slot | 145 | * device resides and the logical device number within that slot |
146 | * in case of multi-function devices. | 146 | * in case of multi-function devices. |
147 | * | 147 | * |
148 | * Note: the bus/slot search is limited to PCI domain (segment) 0. | ||
149 | * | ||
148 | * Given a PCI bus and slot/function number, the desired PCI device | 150 | * Given a PCI bus and slot/function number, the desired PCI device |
149 | * is located in system global list of PCI devices. If the device | 151 | * is located in system global list of PCI devices. If the device |
150 | * is found, a pointer to its data structure is returned. If no | 152 | * is found, a pointer to its data structure is returned. If no |
@@ -157,7 +159,8 @@ struct pci_dev * pci_get_bus_and_slot(unsigned int bus, unsigned int devfn) | |||
157 | struct pci_dev *dev = NULL; | 159 | struct pci_dev *dev = NULL; |
158 | 160 | ||
159 | while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { | 161 | while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { |
160 | if (dev->bus->number == bus && dev->devfn == devfn) | 162 | if (pci_domain_nr(dev->bus) == 0 && |
163 | (dev->bus->number == bus && dev->devfn == devfn)) | ||
161 | return dev; | 164 | return dev; |
162 | } | 165 | } |
163 | return NULL; | 166 | return NULL; |