From: Randy D. <ran...@li...> - 2005-12-16 01:16:47
|
From: Randy Dunlap <ran...@li...> Convert the callers of local acpi_path_name() functions to use the exported version of it. Signed-off-by: Randy Dunlap <ran...@li...> --- drivers/pci/hotplug/pciehprm_acpi.c | 21 ++++++--------------- drivers/pci/hotplug/shpchprm_acpi.c | 19 ++++--------------- 2 files changed, 10 insertions(+), 30 deletions(-) --- linux-2615-rc5g5.orig/drivers/pci/hotplug/pciehprm_acpi.c +++ linux-2615-rc5g5/drivers/pci/hotplug/pciehprm_acpi.c @@ -38,21 +38,6 @@ #define METHOD_NAME__HPP "_HPP" #define METHOD_NAME_OSHP "OSHP" -static u8 * acpi_path_name( acpi_handle handle) -{ - acpi_status status; - static u8 path_name[ACPI_PATHNAME_MAX]; - struct acpi_buffer ret_buf = { ACPI_PATHNAME_MAX, path_name }; - - memset(path_name, 0, sizeof (path_name)); - status = acpi_get_name(handle, ACPI_FULL_PATHNAME, &ret_buf); - - if (ACPI_FAILURE(status)) - return NULL; - else - return path_name; -} - static acpi_status acpi_run_hpp(acpi_handle handle, struct hotplug_params *hpp) { @@ -71,6 +56,7 @@ acpi_run_hpp(acpi_handle handle, struct if (!ret_buf.pointer) { err ("%s:%s alloc for _HPP fail\n", __FUNCTION__, path_name); + kfree(path_name); return AE_NO_MEMORY; } status = acpi_evaluate_object(handle, METHOD_NAME__HPP, @@ -81,6 +67,7 @@ acpi_run_hpp(acpi_handle handle, struct if (ACPI_FAILURE(status)) { dbg("%s:%s _HPP fail=0x%x\n", __FUNCTION__, path_name, status); + kfree(path_name); return status; } } @@ -121,6 +108,7 @@ acpi_run_hpp(acpi_handle handle, struct free_and_return: kfree(ret_buf.pointer); + kfree(path_name); return status; } @@ -137,6 +125,7 @@ static acpi_status acpi_run_oshp(acpi_ha } else { dbg("%s:%s OSHP passes\n", __FUNCTION__, path_name); } + kfree(path_name); return status; } @@ -213,8 +202,10 @@ int pciehp_get_hp_hw_control_from_firmwa if (ACPI_SUCCESS(status)) { dbg("Gained control for hotplug HW for pci %s (%s)\n", pci_name(dev), path_name); + kfree(path_name); return 0; } + kfree(path_name); if (is_root_bridge(handle)) break; chandle = handle; --- linux-2615-rc5g5.orig/drivers/pci/hotplug/shpchprm_acpi.c +++ linux-2615-rc5g5/drivers/pci/hotplug/shpchprm_acpi.c @@ -37,21 +37,6 @@ #define METHOD_NAME__HPP "_HPP" #define METHOD_NAME_OSHP "OSHP" -static u8 * acpi_path_name( acpi_handle handle) -{ - acpi_status status; - static u8 path_name[ACPI_PATHNAME_MAX]; - struct acpi_buffer ret_buf = { ACPI_PATHNAME_MAX, path_name }; - - memset(path_name, 0, sizeof (path_name)); - status = acpi_get_name(handle, ACPI_FULL_PATHNAME, &ret_buf); - - if (ACPI_FAILURE(status)) - return NULL; - else - return path_name; -} - static acpi_status acpi_run_hpp(acpi_handle handle, struct hotplug_params *hpp) { @@ -70,6 +55,7 @@ acpi_run_hpp(acpi_handle handle, struct if (!ret_buf.pointer) { err ("%s:%s alloc for _HPP fail\n", __FUNCTION__, path_name); + kfree(path_name); return AE_NO_MEMORY; } status = acpi_evaluate_object(handle, METHOD_NAME__HPP, @@ -80,6 +66,7 @@ acpi_run_hpp(acpi_handle handle, struct if (ACPI_FAILURE(status)) { dbg("%s:%s _HPP fail=0x%x\n", __FUNCTION__, path_name, status); + kfree(path_name); return status; } } @@ -120,6 +107,7 @@ acpi_run_hpp(acpi_handle handle, struct free_and_return: kfree(ret_buf.pointer); + kfree(path_name); return status; } @@ -136,6 +124,7 @@ static void acpi_run_oshp(acpi_handle ha } else { dbg("%s:%s OSHP passes\n", __FUNCTION__, path_name); } + kfree(path_name); } int shpchprm_get_physical_slot_number(struct controller *ctrl, u32 *sun, u8 busnum, u8 devnum) --- |