[PATCH] acpi bridge hotadd: Export the interface to get PCI id for an ACPI handle

Export an acpi interface to get PCI domain/bus/devfn information from the
corresponding namespace handle. Used by acpiphp code to transpate the device
handle of the hot-plugged root bridge to the corresponding pci location
information.

Signed-off-by: Rajesh Shah <rajesh.shah@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Rajesh Shah and committed by
Greg Kroah-Hartman
4ce448e5 3fb02738

+6 -6
+5 -6
drivers/acpi/pci_bind.c
··· 61 62 63 /** 64 - * acpi_os_get_pci_id 65 * ------------------ 66 * This function is used by the ACPI Interpreter (a.k.a. Core Subsystem) 67 * to resolve PCI information for ACPI-PCI devices defined in the namespace. 68 * This typically occurs when resolving PCI operation region information. 69 */ 70 - #ifdef ACPI_FUTURE_USAGE 71 acpi_status 72 - acpi_os_get_pci_id ( 73 acpi_handle handle, 74 struct acpi_pci_id *id) 75 { ··· 77 struct acpi_device *device = NULL; 78 struct acpi_pci_data *data = NULL; 79 80 - ACPI_FUNCTION_TRACE("acpi_os_get_pci_id"); 81 82 if (!id) 83 return_ACPI_STATUS(AE_BAD_PARAMETER); ··· 91 } 92 93 status = acpi_get_data(handle, acpi_pci_data_handler, (void**) &data); 94 - if (ACPI_FAILURE(status) || !data || !data->dev) { 95 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 96 "Invalid ACPI-PCI context for device %s\n", 97 acpi_device_bid(device))); ··· 114 115 return_ACPI_STATUS(AE_OK); 116 } 117 - #endif /* ACPI_FUTURE_USAGE */ 118 119 120 int
··· 61 62 63 /** 64 + * acpi_get_pci_id 65 * ------------------ 66 * This function is used by the ACPI Interpreter (a.k.a. Core Subsystem) 67 * to resolve PCI information for ACPI-PCI devices defined in the namespace. 68 * This typically occurs when resolving PCI operation region information. 69 */ 70 acpi_status 71 + acpi_get_pci_id ( 72 acpi_handle handle, 73 struct acpi_pci_id *id) 74 { ··· 78 struct acpi_device *device = NULL; 79 struct acpi_pci_data *data = NULL; 80 81 + ACPI_FUNCTION_TRACE("acpi_get_pci_id"); 82 83 if (!id) 84 return_ACPI_STATUS(AE_BAD_PARAMETER); ··· 92 } 93 94 status = acpi_get_data(handle, acpi_pci_data_handler, (void**) &data); 95 + if (ACPI_FAILURE(status) || !data) { 96 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 97 "Invalid ACPI-PCI context for device %s\n", 98 acpi_device_bid(device))); ··· 115 116 return_ACPI_STATUS(AE_OK); 117 } 118 + EXPORT_SYMBOL(acpi_get_pci_id); 119 120 121 int
+1
include/acpi/acpi_drivers.h
··· 68 69 struct pci_bus; 70 71 int acpi_pci_bind (struct acpi_device *device); 72 int acpi_pci_unbind (struct acpi_device *device); 73 int acpi_pci_bind_root (struct acpi_device *device, struct acpi_pci_id *id, struct pci_bus *bus);
··· 68 69 struct pci_bus; 70 71 + acpi_status acpi_get_pci_id (acpi_handle handle, struct acpi_pci_id *id); 72 int acpi_pci_bind (struct acpi_device *device); 73 int acpi_pci_unbind (struct acpi_device *device); 74 int acpi_pci_bind_root (struct acpi_device *device, struct acpi_pci_id *id, struct pci_bus *bus);