aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/acpica/hwpci.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/acpi/acpica/hwpci.c b/drivers/acpi/acpica/hwpci.c
index c5214dec4988..f785ea788356 100644
--- a/drivers/acpi/acpica/hwpci.c
+++ b/drivers/acpi/acpica/hwpci.c
@@ -123,7 +123,7 @@ acpi_hw_derive_pci_id(struct acpi_pci_id *pci_id,
123 acpi_handle root_pci_device, acpi_handle pci_region) 123 acpi_handle root_pci_device, acpi_handle pci_region)
124{ 124{
125 acpi_status status; 125 acpi_status status;
126 struct acpi_pci_device *list_head = NULL; 126 struct acpi_pci_device *list_head;
127 127
128 ACPI_FUNCTION_TRACE(hw_derive_pci_id); 128 ACPI_FUNCTION_TRACE(hw_derive_pci_id);
129 129
@@ -177,13 +177,13 @@ acpi_hw_build_pci_list(acpi_handle root_pci_device,
177 acpi_handle parent_device; 177 acpi_handle parent_device;
178 acpi_status status; 178 acpi_status status;
179 struct acpi_pci_device *list_element; 179 struct acpi_pci_device *list_element;
180 struct acpi_pci_device *list_head = NULL;
181 180
182 /* 181 /*
183 * Ascend namespace branch until the root_pci_device is reached, building 182 * Ascend namespace branch until the root_pci_device is reached, building
184 * a list of device nodes. Loop will exit when either the PCI device is 183 * a list of device nodes. Loop will exit when either the PCI device is
185 * found, or the root of the namespace is reached. 184 * found, or the root of the namespace is reached.
186 */ 185 */
186 *return_list_head = NULL;
187 current_device = pci_region; 187 current_device = pci_region;
188 while (1) { 188 while (1) {
189 status = acpi_get_parent(current_device, &parent_device); 189 status = acpi_get_parent(current_device, &parent_device);
@@ -198,7 +198,6 @@ acpi_hw_build_pci_list(acpi_handle root_pci_device,
198 /* Finished when we reach the PCI root device (PNP0A03 or PNP0A08) */ 198 /* Finished when we reach the PCI root device (PNP0A03 or PNP0A08) */
199 199
200 if (parent_device == root_pci_device) { 200 if (parent_device == root_pci_device) {
201 *return_list_head = list_head;
202 return (AE_OK); 201 return (AE_OK);
203 } 202 }
204 203
@@ -213,9 +212,9 @@ acpi_hw_build_pci_list(acpi_handle root_pci_device,
213 212
214 /* Put new element at the head of the list */ 213 /* Put new element at the head of the list */
215 214
216 list_element->next = list_head; 215 list_element->next = *return_list_head;
217 list_element->device = parent_device; 216 list_element->device = parent_device;
218 list_head = list_element; 217 *return_list_head = list_element;
219 218
220 current_device = parent_device; 219 current_device = parent_device;
221 } 220 }