From: Randy D. <ran...@li...> - 2005-12-21 20:04:43
|
From: Randy Dunlap <ran...@li...> Make acpi_path_name() usable by everyone. I need this for adding SATA suspend/resume ACPI support. v4: Fix enter/exit trace error noted by Matthew Wilcox. v3: use EXPORT_SYMBOL_GPL for acpi_path_name. v2: use ACPI-CA calling convention for name buffer. Signed-off-by: Randy Dunlap <ran...@li...> --- drivers/acpi/osl.c | 21 +++++++++++++++++++++ include/acpi/acpiosxf.h | 2 ++ 2 files changed, 23 insertions(+) --- linux-2615-rc6-acpi.orig/drivers/acpi/osl.c +++ linux-2615-rc6-acpi/drivers/acpi/osl.c @@ -1078,6 +1078,27 @@ void acpi_os_release_lock(acpi_handle ha spin_unlock_irqrestore((spinlock_t *) handle, flags); } +/** + * acpi_path_name - get ACPI path_name for the given handle + * @handle: ACPI object handle to look up name of + * @namebuf: acpi_buffer with input flags and output name + * + * Caller can allocate & free the output name buffer or can set + * namebuf.length to ACPI_ALLOCATE_BUFFER to have ACPI-CA allocate + * the buffer but caller is still responsible for freeing it. + * + * Returns: status of acpi_get_name() + */ +acpi_status acpi_path_name(acpi_handle handle, struct acpi_buffer *namebuf) +{ + acpi_status status; + + status = acpi_get_name(handle, ACPI_FULL_PATHNAME, namebuf); + + return status; +} +EXPORT_SYMBOL_GPL(acpi_path_name); + #ifndef ACPI_USE_LOCAL_CACHE /******************************************************************************* --- linux-2615-rc6-acpi.orig/include/acpi/acpiosxf.h +++ linux-2615-rc6-acpi/include/acpi/acpiosxf.h @@ -112,6 +112,8 @@ unsigned long acpi_os_acquire_lock(acpi_ void acpi_os_release_lock(acpi_handle handle, unsigned long flags); +acpi_status acpi_path_name(acpi_handle handle, struct acpi_buffer *namebuf); + /* * Memory allocation and mapping */ --- |