ACPI: Introduce acpi_unload_parent_table() usages in Linux kernel

ACPICA has implemented acpi_unload_parent_table() which can exactly replace
the acpi_get_id()/acpi_unload_table_id() implemented in Linux kernel.  The
acpi_unload_parent_table() has been unit tested in ACPICA simulation
environment.

This patch can also help to reduce the source code differences between
Linux and ACPICA.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Octavian Purdila <octavian.purdila@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Lv Zheng
2015-01-26 16:58:48 +08:00
committed by Rafael J. Wysocki
parent 97d746578b
commit e044d8f92f
4 changed files with 7 additions and 102 deletions

View File

@@ -475,7 +475,7 @@ static int disable_slot(struct hotplug_slot *bss_hotplug_slot)
struct slot *slot = bss_hotplug_slot->private;
struct pci_dev *dev, *temp;
int rc;
acpi_owner_id ssdt_id = 0;
acpi_handle ssdt_hdl = NULL;
/* Acquire update access to the bus */
mutex_lock(&sn_hotplug_mutex);
@@ -522,7 +522,7 @@ static int disable_slot(struct hotplug_slot *bss_hotplug_slot)
if (ACPI_SUCCESS(ret) &&
(adr>>16) == (slot->device_num + 1)) {
/* retain the owner id */
acpi_get_id(chandle, &ssdt_id);
ssdt_hdl = chandle;
ret = acpi_bus_get_device(chandle,
&device);
@@ -547,12 +547,13 @@ static int disable_slot(struct hotplug_slot *bss_hotplug_slot)
pci_unlock_rescan_remove();
/* Remove the SSDT for the slot from the ACPI namespace */
if (SN_ACPI_BASE_SUPPORT() && ssdt_id) {
if (SN_ACPI_BASE_SUPPORT() && ssdt_hdl) {
acpi_status ret;
ret = acpi_unload_table_id(ssdt_id);
ret = acpi_unload_parent_table(ssdt_hdl);
if (ACPI_FAILURE(ret)) {
printk(KERN_ERR "%s: acpi_unload_table_id failed (0x%x) for id %d\n",
__func__, ret, ssdt_id);
acpi_handle_err(ssdt_hdl,
"%s: acpi_unload_parent_table failed (0x%x)\n",
__func__, ret);
/* try to continue on */
}
}