aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2015-01-26 03:58:48 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-01-26 10:08:49 -0500
commite044d8f92f79db167bb7f9dfd0f317e3238d82d1 (patch)
tree682e368f69212caf930a0c56701eba3f41f71bdd /drivers/pci
parent97d746578b1fc4ce461e6279220cab3605f02469 (diff)
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>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/hotplug/sgi_hotplug.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/pci/hotplug/sgi_hotplug.c b/drivers/pci/hotplug/sgi_hotplug.c
index bada20999870..c32fb786d48e 100644
--- a/drivers/pci/hotplug/sgi_hotplug.c
+++ b/drivers/pci/hotplug/sgi_hotplug.c
@@ -475,7 +475,7 @@ static int disable_slot(struct hotplug_slot *bss_hotplug_slot)
475 struct slot *slot = bss_hotplug_slot->private; 475 struct slot *slot = bss_hotplug_slot->private;
476 struct pci_dev *dev, *temp; 476 struct pci_dev *dev, *temp;
477 int rc; 477 int rc;
478 acpi_owner_id ssdt_id = 0; 478 acpi_handle ssdt_hdl = NULL;
479 479
480 /* Acquire update access to the bus */ 480 /* Acquire update access to the bus */
481 mutex_lock(&sn_hotplug_mutex); 481 mutex_lock(&sn_hotplug_mutex);
@@ -522,7 +522,7 @@ static int disable_slot(struct hotplug_slot *bss_hotplug_slot)
522 if (ACPI_SUCCESS(ret) && 522 if (ACPI_SUCCESS(ret) &&
523 (adr>>16) == (slot->device_num + 1)) { 523 (adr>>16) == (slot->device_num + 1)) {
524 /* retain the owner id */ 524 /* retain the owner id */
525 acpi_get_id(chandle, &ssdt_id); 525 ssdt_hdl = chandle;
526 526
527 ret = acpi_bus_get_device(chandle, 527 ret = acpi_bus_get_device(chandle,
528 &device); 528 &device);
@@ -547,12 +547,13 @@ static int disable_slot(struct hotplug_slot *bss_hotplug_slot)
547 pci_unlock_rescan_remove(); 547 pci_unlock_rescan_remove();
548 548
549 /* Remove the SSDT for the slot from the ACPI namespace */ 549 /* Remove the SSDT for the slot from the ACPI namespace */
550 if (SN_ACPI_BASE_SUPPORT() && ssdt_id) { 550 if (SN_ACPI_BASE_SUPPORT() && ssdt_hdl) {
551 acpi_status ret; 551 acpi_status ret;
552 ret = acpi_unload_table_id(ssdt_id); 552 ret = acpi_unload_parent_table(ssdt_hdl);
553 if (ACPI_FAILURE(ret)) { 553 if (ACPI_FAILURE(ret)) {
554 printk(KERN_ERR "%s: acpi_unload_table_id failed (0x%x) for id %d\n", 554 acpi_handle_err(ssdt_hdl,
555 __func__, ret, ssdt_id); 555 "%s: acpi_unload_parent_table failed (0x%x)\n",
556 __func__, ret);
556 /* try to continue on */ 557 /* try to continue on */
557 } 558 }
558 } 559 }