diff options
Diffstat (limited to 'drivers/acpi/pci_bind.c')
-rw-r--r-- | drivers/acpi/pci_bind.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/acpi/pci_bind.c b/drivers/acpi/pci_bind.c index 5d19b39e9e2b..7753df1f9fb8 100644 --- a/drivers/acpi/pci_bind.c +++ b/drivers/acpi/pci_bind.c | |||
@@ -129,6 +129,8 @@ acpi_pci_bind ( | |||
129 | char *pathname = NULL; | 129 | char *pathname = NULL; |
130 | struct acpi_buffer buffer = {0, NULL}; | 130 | struct acpi_buffer buffer = {0, NULL}; |
131 | acpi_handle handle = NULL; | 131 | acpi_handle handle = NULL; |
132 | struct pci_dev *dev; | ||
133 | struct pci_bus *bus; | ||
132 | 134 | ||
133 | ACPI_FUNCTION_TRACE("acpi_pci_bind"); | 135 | ACPI_FUNCTION_TRACE("acpi_pci_bind"); |
134 | 136 | ||
@@ -193,8 +195,20 @@ acpi_pci_bind ( | |||
193 | * Locate matching device in PCI namespace. If it doesn't exist | 195 | * Locate matching device in PCI namespace. If it doesn't exist |
194 | * this typically means that the device isn't currently inserted | 196 | * this typically means that the device isn't currently inserted |
195 | * (e.g. docking station, port replicator, etc.). | 197 | * (e.g. docking station, port replicator, etc.). |
198 | * We cannot simply search the global pci device list, since | ||
199 | * PCI devices are added to the global pci list when the root | ||
200 | * bridge start ops are run, which may not have happened yet. | ||
196 | */ | 201 | */ |
197 | data->dev = pci_find_slot(data->id.bus, PCI_DEVFN(data->id.device, data->id.function)); | 202 | bus = pci_find_bus(data->id.segment, data->id.bus); |
203 | if (bus) { | ||
204 | list_for_each_entry(dev, &bus->devices, bus_list) { | ||
205 | if (dev->devfn == PCI_DEVFN(data->id.device, | ||
206 | data->id.function)) { | ||
207 | data->dev = dev; | ||
208 | break; | ||
209 | } | ||
210 | } | ||
211 | } | ||
198 | if (!data->dev) { | 212 | if (!data->dev) { |
199 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 213 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
200 | "Device %02x:%02x:%02x.%02x not present in PCI namespace\n", | 214 | "Device %02x:%02x:%02x.%02x not present in PCI namespace\n", |