aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorTaku Izumi <izumi.taku@jp.fujitsu.com>2012-09-18 02:23:23 -0400
committerBjorn Helgaas <bhelgaas@google.com>2012-09-24 17:29:40 -0400
commitcd4faf9c34b27cbb6bcc70a4f1d1759f2e6fa7fd (patch)
treee33941ddbff56873ef29e33ec090289a06c84e96 /drivers/acpi
parent6507e6ebebd2d5f7e17c6f2e32524270edd2a922 (diff)
PCI/ACPI: Use acpi_driver_data() rather than searching acpi_pci_roots
This patch changes the implementation of acpi_pci_find_root(). We can access acpi_pci_root without scanning acpi_pci_roots list. If hostbridge hotplug is supported, acpi_pci_roots list will be protected by mutex. We should not access acpi_pci_roots list if preventable to lessen deadlock risk. Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/pci_root.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index e1bdcc700cb..13f9b5ba335 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -270,12 +270,15 @@ static acpi_status acpi_pci_osc_support(struct acpi_pci_root *root, u32 flags)
270struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle) 270struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle)
271{ 271{
272 struct acpi_pci_root *root; 272 struct acpi_pci_root *root;
273 struct acpi_device *device;
273 274
274 list_for_each_entry(root, &acpi_pci_roots, node) { 275 if (acpi_bus_get_device(handle, &device) ||
275 if (root->device->handle == handle) 276 acpi_match_device_ids(device, root_device_ids))
276 return root; 277 return NULL;
277 } 278
278 return NULL; 279 root = acpi_driver_data(device);
280
281 return root;
279} 282}
280EXPORT_SYMBOL_GPL(acpi_pci_find_root); 283EXPORT_SYMBOL_GPL(acpi_pci_find_root);
281 284