aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/pci_root.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/pci_root.c')
-rw-r--r--drivers/acpi/pci_root.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 1f06229040ac..4ecf701687e8 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -165,6 +165,21 @@ static acpi_status try_get_root_bridge_busnr(acpi_handle handle, int *busnum)
165 return AE_OK; 165 return AE_OK;
166} 166}
167 167
168static void acpi_pci_bridge_scan(struct acpi_device *device)
169{
170 int status;
171 struct acpi_device *child = NULL;
172
173 if (device->flags.bus_address)
174 if (device->parent && device->parent->ops.bind) {
175 status = device->parent->ops.bind(device);
176 if (!status) {
177 list_for_each_entry(child, &device->children, node)
178 acpi_pci_bridge_scan(child);
179 }
180 }
181}
182
168static int acpi_pci_root_add(struct acpi_device *device) 183static int acpi_pci_root_add(struct acpi_device *device)
169{ 184{
170 int result = 0; 185 int result = 0;
@@ -173,6 +188,7 @@ static int acpi_pci_root_add(struct acpi_device *device)
173 acpi_status status = AE_OK; 188 acpi_status status = AE_OK;
174 unsigned long value = 0; 189 unsigned long value = 0;
175 acpi_handle handle = NULL; 190 acpi_handle handle = NULL;
191 struct acpi_device *child;
176 192
177 193
178 if (!device) 194 if (!device)
@@ -188,9 +204,6 @@ static int acpi_pci_root_add(struct acpi_device *device)
188 strcpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS); 204 strcpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS);
189 acpi_driver_data(device) = root; 205 acpi_driver_data(device) = root;
190 206
191 /*
192 * TBD: Doesn't the bus driver automatically set this?
193 */
194 device->ops.bind = acpi_pci_bind; 207 device->ops.bind = acpi_pci_bind;
195 208
196 /* 209 /*
@@ -312,6 +325,12 @@ static int acpi_pci_root_add(struct acpi_device *device)
312 result = acpi_pci_irq_add_prt(device->handle, root->id.segment, 325 result = acpi_pci_irq_add_prt(device->handle, root->id.segment,
313 root->id.bus); 326 root->id.bus);
314 327
328 /*
329 * Scan and bind all _ADR-Based Devices
330 */
331 list_for_each_entry(child, &device->children, node)
332 acpi_pci_bridge_scan(child);
333
315 end: 334 end:
316 if (result) { 335 if (result) {
317 if (!list_empty(&root->node)) 336 if (!list_empty(&root->node))