diff options
author | Jiang Liu <jiang.liu@huawei.com> | 2012-09-18 02:19:49 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2012-09-24 17:29:40 -0400 |
commit | 8ee5bdf3e9c99808bf271aa5cc41d689e6d9d3eb (patch) | |
tree | 079476becf6c0791ff66db28a563eb2c8176f236 /drivers/acpi | |
parent | 059e4ba292c69cb400cda92fbd37f25d4eec564b (diff) |
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')
-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 = { | |||
72 | }; | 72 | }; |
73 | 73 | ||
74 | static LIST_HEAD(acpi_pci_roots); | 74 | static LIST_HEAD(acpi_pci_roots); |
75 | static LIST_HEAD(acpi_pci_drivers); | ||
75 | 76 | ||
76 | static struct acpi_pci_driver *sub_driver; | ||
77 | static DEFINE_MUTEX(osc_lock); | 77 | static DEFINE_MUTEX(osc_lock); |
78 | 78 | ||
79 | int acpi_pci_register_driver(struct acpi_pci_driver *driver) | 79 | int acpi_pci_register_driver(struct acpi_pci_driver *driver) |
@@ -81,10 +81,7 @@ int acpi_pci_register_driver(struct acpi_pci_driver *driver) | |||
81 | int n = 0; | 81 | int n = 0; |
82 | struct acpi_pci_root *root; | 82 | struct acpi_pci_root *root; |
83 | 83 | ||
84 | struct acpi_pci_driver **pptr = &sub_driver; | 84 | list_add_tail(&driver->node, &acpi_pci_drivers); |
85 | while (*pptr) | ||
86 | pptr = &(*pptr)->next; | ||
87 | *pptr = driver; | ||
88 | 85 | ||
89 | if (!driver->add) | 86 | if (!driver->add) |
90 | return 0; | 87 | return 0; |
@@ -103,14 +100,7 @@ void acpi_pci_unregister_driver(struct acpi_pci_driver *driver) | |||
103 | { | 100 | { |
104 | struct acpi_pci_root *root; | 101 | struct acpi_pci_root *root; |
105 | 102 | ||
106 | struct acpi_pci_driver **pptr = &sub_driver; | 103 | list_del(&driver->node); |
107 | while (*pptr) { | ||
108 | if (*pptr == driver) | ||
109 | break; | ||
110 | pptr = &(*pptr)->next; | ||
111 | } | ||
112 | BUG_ON(!*pptr); | ||
113 | *pptr = (*pptr)->next; | ||
114 | 104 | ||
115 | if (!driver->remove) | 105 | if (!driver->remove) |
116 | return; | 106 | return; |