summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/pci_root.c
diff options
context:
space:
mode:
authorTaku Izumi <izumi.taku@jp.fujitsu.com>2012-09-18 08:22:35 +0200
committerBjorn Helgaas <bhelgaas@google.com>2012-09-24 23:29:40 +0200
commit55bfe3c0c561783655a8ff2f6f3f19ac1362b132 (patch)
tree270c4b1344f93f417e46f6abd9a9c91a5a3e8c55 /drivers/acpi/pci_root.c
parentPCI/ACPI: Protect acpi_pci_drivers list with mutex (diff)
downloadlinux-55bfe3c0c561783655a8ff2f6f3f19ac1362b132.tar.xz
linux-55bfe3c0c561783655a8ff2f6f3f19ac1362b132.zip
PCI/ACPI: Pass acpi_pci_root to acpi_pci_drivers' add/remove interface
This patch changes .add/.remove interfaces of acpi_pci_driver. In the current implementation acpi_handle is passed as a parameter of .add/.remove interface. However, the acpi_pci_root structure contains more useful information than just the acpi_handle. This enables us to avoid some useless lookups in each acpi_pci_driver. Note: This changes interfaces used by acpi_pci_register_driver(), an exported symbol. This patch updates all the in-kernel users, but any out-of-kernel acpi_pci_register_driver() users will need updates. [bhelgaas: changelog] Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/acpi/pci_root.c')
-rw-r--r--drivers/acpi/pci_root.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index d710585e4a7f..2868a9ff6d07 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -87,7 +87,7 @@ int acpi_pci_register_driver(struct acpi_pci_driver *driver)
list_add_tail(&driver->node, &acpi_pci_drivers);
if (driver->add)
list_for_each_entry(root, &acpi_pci_roots, node) {
- driver->add(root->device->handle);
+ driver->add(root);
n++;
}
mutex_unlock(&acpi_pci_root_lock);
@@ -104,7 +104,7 @@ void acpi_pci_unregister_driver(struct acpi_pci_driver *driver)
list_del(&driver->node);
if (driver->remove)
list_for_each_entry(root, &acpi_pci_roots, node)
- driver->remove(root->device->handle);
+ driver->remove(root);
mutex_unlock(&acpi_pci_root_lock);
}
EXPORT_SYMBOL(acpi_pci_unregister_driver);
@@ -629,7 +629,7 @@ static int acpi_pci_root_start(struct acpi_device *device)
mutex_lock(&acpi_pci_root_lock);
list_for_each_entry(driver, &acpi_pci_drivers, node)
if (driver->add)
- driver->add(device->handle);
+ driver->add(root);
mutex_unlock(&acpi_pci_root_lock);
pci_bus_add_devices(root->bus);
@@ -645,7 +645,7 @@ static int acpi_pci_root_remove(struct acpi_device *device, int type)
mutex_lock(&acpi_pci_root_lock);
list_for_each_entry(driver, &acpi_pci_drivers, node)
if (driver->remove)
- driver->remove(root->device->handle);
+ driver->remove(root);
mutex_unlock(&acpi_pci_root_lock);
device_set_run_wake(root->bus->bridge, false);