diff options
Diffstat (limited to 'drivers/acpi/ioapic.c')
-rw-r--r-- | drivers/acpi/ioapic.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/drivers/acpi/ioapic.c b/drivers/acpi/ioapic.c index 6d7ce6e12aaa..7e4fbf9a53a3 100644 --- a/drivers/acpi/ioapic.c +++ b/drivers/acpi/ioapic.c | |||
@@ -45,6 +45,12 @@ static acpi_status setup_res(struct acpi_resource *acpi_res, void *data) | |||
45 | struct resource *res = data; | 45 | struct resource *res = data; |
46 | struct resource_win win; | 46 | struct resource_win win; |
47 | 47 | ||
48 | /* | ||
49 | * We might assign this to 'res' later, make sure all pointers are | ||
50 | * cleared before the resource is added to the global list | ||
51 | */ | ||
52 | memset(&win, 0, sizeof(win)); | ||
53 | |||
48 | res->flags = 0; | 54 | res->flags = 0; |
49 | if (acpi_dev_filter_resource_type(acpi_res, IORESOURCE_MEM)) | 55 | if (acpi_dev_filter_resource_type(acpi_res, IORESOURCE_MEM)) |
50 | return AE_OK; | 56 | return AE_OK; |
@@ -206,24 +212,34 @@ int acpi_ioapic_add(acpi_handle root_handle) | |||
206 | return ACPI_SUCCESS(status) && ACPI_SUCCESS(retval) ? 0 : -ENODEV; | 212 | return ACPI_SUCCESS(status) && ACPI_SUCCESS(retval) ? 0 : -ENODEV; |
207 | } | 213 | } |
208 | 214 | ||
209 | int acpi_ioapic_remove(struct acpi_pci_root *root) | 215 | void pci_ioapic_remove(struct acpi_pci_root *root) |
210 | { | 216 | { |
211 | int retval = 0; | ||
212 | struct acpi_pci_ioapic *ioapic, *tmp; | 217 | struct acpi_pci_ioapic *ioapic, *tmp; |
213 | 218 | ||
214 | mutex_lock(&ioapic_list_lock); | 219 | mutex_lock(&ioapic_list_lock); |
215 | list_for_each_entry_safe(ioapic, tmp, &ioapic_list, list) { | 220 | list_for_each_entry_safe(ioapic, tmp, &ioapic_list, list) { |
216 | if (root->device->handle != ioapic->root_handle) | 221 | if (root->device->handle != ioapic->root_handle) |
217 | continue; | 222 | continue; |
218 | |||
219 | if (acpi_unregister_ioapic(ioapic->handle, ioapic->gsi_base)) | ||
220 | retval = -EBUSY; | ||
221 | |||
222 | if (ioapic->pdev) { | 223 | if (ioapic->pdev) { |
223 | pci_release_region(ioapic->pdev, 0); | 224 | pci_release_region(ioapic->pdev, 0); |
224 | pci_disable_device(ioapic->pdev); | 225 | pci_disable_device(ioapic->pdev); |
225 | pci_dev_put(ioapic->pdev); | 226 | pci_dev_put(ioapic->pdev); |
226 | } | 227 | } |
228 | } | ||
229 | mutex_unlock(&ioapic_list_lock); | ||
230 | } | ||
231 | |||
232 | int acpi_ioapic_remove(struct acpi_pci_root *root) | ||
233 | { | ||
234 | int retval = 0; | ||
235 | struct acpi_pci_ioapic *ioapic, *tmp; | ||
236 | |||
237 | mutex_lock(&ioapic_list_lock); | ||
238 | list_for_each_entry_safe(ioapic, tmp, &ioapic_list, list) { | ||
239 | if (root->device->handle != ioapic->root_handle) | ||
240 | continue; | ||
241 | if (acpi_unregister_ioapic(ioapic->handle, ioapic->gsi_base)) | ||
242 | retval = -EBUSY; | ||
227 | if (ioapic->res.flags && ioapic->res.parent) | 243 | if (ioapic->res.flags && ioapic->res.parent) |
228 | release_resource(&ioapic->res); | 244 | release_resource(&ioapic->res); |
229 | list_del(&ioapic->list); | 245 | list_del(&ioapic->list); |