diff options
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; |