diff options
author | Jiang Liu <jiang.liu@huawei.com> | 2012-09-18 08:19:49 +0200 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2012-09-24 23:29:40 +0200 |
commit | 8ee5bdf3e9c99808bf271aa5cc41d689e6d9d3eb (patch) | |
tree | 079476becf6c0791ff66db28a563eb2c8176f236 /drivers/acpi/pci_root.c | |
parent | PCI/ACPI: Use DEVICE_ACPI_HANDLE rather than searching acpi_pci_roots (diff) | |
download | linux-8ee5bdf3e9c99808bf271aa5cc41d689e6d9d3eb.tar.xz linux-8ee5bdf3e9c99808bf271aa5cc41d689e6d9d3eb.zip |
PCI/ACPI: Use normal list for struct acpi_pci_driver
Use normal list for struct acpi_pci_driver to simplify code.
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
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.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index ec54014c321c..68d679e21248 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -72,8 +72,8 @@ static struct acpi_driver acpi_pci_root_driver = { }; static LIST_HEAD(acpi_pci_roots); +static LIST_HEAD(acpi_pci_drivers); -static struct acpi_pci_driver *sub_driver; static DEFINE_MUTEX(osc_lock); int acpi_pci_register_driver(struct acpi_pci_driver *driver) @@ -81,10 +81,7 @@ int acpi_pci_register_driver(struct acpi_pci_driver *driver) int n = 0; struct acpi_pci_root *root; - struct acpi_pci_driver **pptr = &sub_driver; - while (*pptr) - pptr = &(*pptr)->next; - *pptr = driver; + list_add_tail(&driver->node, &acpi_pci_drivers); if (!driver->add) return 0; @@ -103,14 +100,7 @@ void acpi_pci_unregister_driver(struct acpi_pci_driver *driver) { struct acpi_pci_root *root; - struct acpi_pci_driver **pptr = &sub_driver; - while (*pptr) { - if (*pptr == driver) - break; - pptr = &(*pptr)->next; - } - BUG_ON(!*pptr); - *pptr = (*pptr)->next; + list_del(&driver->node); if (!driver->remove) return; |