diff options
author | David E. Box <david.e.box@linux.intel.com> | 2014-04-29 22:04:20 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-05-06 18:55:00 -0400 |
commit | c28fa24b97789bd61b09014380a2eb71a522090a (patch) | |
tree | 9e2aaeec4097c6863a7e90b1b315b9c00a14cd38 | |
parent | 92cb3a8d37b96f6aeee9ebe5336dd8a8e67580a4 (diff) |
ACPICA: Update handling of PCI ID lists.
More of a style cleanup. If hw_build_pci_list is to return a non-zero
status, it now deletes any partial ID list that has been constructed.
If it returns AE_OK, the caller is responsible for list deletion.
David Box.
Signed-off-by: David E. Box <david.e.box@linux.intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/acpi/acpica/hwpci.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/acpi/acpica/hwpci.c b/drivers/acpi/acpica/hwpci.c index e701d8c33dbf..6aade8e1d2a1 100644 --- a/drivers/acpi/acpica/hwpci.c +++ b/drivers/acpi/acpica/hwpci.c | |||
@@ -140,11 +140,12 @@ acpi_hw_derive_pci_id(struct acpi_pci_id *pci_id, | |||
140 | /* Walk the list, updating the PCI device/function/bus numbers */ | 140 | /* Walk the list, updating the PCI device/function/bus numbers */ |
141 | 141 | ||
142 | status = acpi_hw_process_pci_list(pci_id, list_head); | 142 | status = acpi_hw_process_pci_list(pci_id, list_head); |
143 | } | ||
144 | 143 | ||
145 | /* Always delete the list */ | 144 | /* Delete the list */ |
145 | |||
146 | acpi_hw_delete_pci_list(list_head); | ||
147 | } | ||
146 | 148 | ||
147 | acpi_hw_delete_pci_list(list_head); | ||
148 | return_ACPI_STATUS(status); | 149 | return_ACPI_STATUS(status); |
149 | } | 150 | } |
150 | 151 | ||
@@ -187,6 +188,10 @@ acpi_hw_build_pci_list(acpi_handle root_pci_device, | |||
187 | while (1) { | 188 | while (1) { |
188 | status = acpi_get_parent(current_device, &parent_device); | 189 | status = acpi_get_parent(current_device, &parent_device); |
189 | if (ACPI_FAILURE(status)) { | 190 | if (ACPI_FAILURE(status)) { |
191 | |||
192 | /* Must delete the list before exit */ | ||
193 | |||
194 | acpi_hw_delete_pci_list(*return_list_head); | ||
190 | return (status); | 195 | return (status); |
191 | } | 196 | } |
192 | 197 | ||
@@ -199,6 +204,10 @@ acpi_hw_build_pci_list(acpi_handle root_pci_device, | |||
199 | 204 | ||
200 | list_element = ACPI_ALLOCATE(sizeof(struct acpi_pci_device)); | 205 | list_element = ACPI_ALLOCATE(sizeof(struct acpi_pci_device)); |
201 | if (!list_element) { | 206 | if (!list_element) { |
207 | |||
208 | /* Must delete the list before exit */ | ||
209 | |||
210 | acpi_hw_delete_pci_list(*return_list_head); | ||
202 | return (AE_NO_MEMORY); | 211 | return (AE_NO_MEMORY); |
203 | } | 212 | } |
204 | 213 | ||