Skip to content

Commit

Permalink
Pull acpi_os_free into release branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Len Brown committed Jul 1, 2006
2 parents fc25465 + 02438d8 commit b197ba3
Show file tree
Hide file tree
Showing 19 changed files with 36 additions and 45 deletions.
2 changes: 1 addition & 1 deletion arch/ia64/kernel/acpi-ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static acpi_status hp_ccsr_locate(acpi_handle obj, u64 *base, u64 *length)
memcpy(length, vendor->byte_data + 8, sizeof(*length));

exit:
acpi_os_free(buffer.pointer);
kfree(buffer.pointer);
return status;
}

Expand Down
12 changes: 6 additions & 6 deletions arch/ia64/kernel/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -856,21 +856,21 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
obj = buffer.pointer;
if (obj->type != ACPI_TYPE_BUFFER ||
obj->buffer.length < sizeof(*lsapic)) {
acpi_os_free(buffer.pointer);
kfree(buffer.pointer);
return -EINVAL;
}

lsapic = (struct acpi_table_lsapic *)obj->buffer.pointer;

if ((lsapic->header.type != ACPI_MADT_LSAPIC) ||
(!lsapic->flags.enabled)) {
acpi_os_free(buffer.pointer);
kfree(buffer.pointer);
return -EINVAL;
}

physid = ((lsapic->id << 8) | (lsapic->eid));

acpi_os_free(buffer.pointer);
kfree(buffer.pointer);
buffer.length = ACPI_ALLOCATE_BUFFER;
buffer.pointer = NULL;

Expand Down Expand Up @@ -934,20 +934,20 @@ acpi_map_iosapic(acpi_handle handle, u32 depth, void *context, void **ret)
obj = buffer.pointer;
if (obj->type != ACPI_TYPE_BUFFER ||
obj->buffer.length < sizeof(*iosapic)) {
acpi_os_free(buffer.pointer);
kfree(buffer.pointer);
return AE_OK;
}

iosapic = (struct acpi_table_iosapic *)obj->buffer.pointer;

if (iosapic->header.type != ACPI_MADT_IOSAPIC) {
acpi_os_free(buffer.pointer);
kfree(buffer.pointer);
return AE_OK;
}

gsi_base = iosapic->global_irq_base;

acpi_os_free(buffer.pointer);
kfree(buffer.pointer);

/*
* OK, it's an IOSAPIC MADT entry, look for a _PXM value to tell
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/acpi_memhotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ static acpi_status is_memory_device(acpi_handle handle)

info = buffer.pointer;
if (!(info->valid & ACPI_VALID_HID)) {
acpi_os_free(buffer.pointer);
kfree(buffer.pointer);
return AE_ERROR;
}

Expand All @@ -475,7 +475,7 @@ static acpi_status is_memory_device(acpi_handle handle)
(strcmp(hardware_id, ACPI_MEMORY_DEVICE_HID)))
status = AE_ERROR;

acpi_os_free(buffer.pointer);
kfree(buffer.pointer);
return status;
}

Expand Down
6 changes: 3 additions & 3 deletions drivers/acpi/asus_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ static int asus_hotk_get_info(void)
}
hotk->methods = &model_conf[hotk->model];

acpi_os_free(model);
kfree(model);

return AE_OK;
}
Expand Down Expand Up @@ -1096,7 +1096,7 @@ static int asus_hotk_get_info(void)
/* S1300A reports L84F, but L1400B too, account for that */
}

acpi_os_free(model);
kfree(model);

return AE_OK;
}
Expand Down Expand Up @@ -1256,7 +1256,7 @@ static void __exit asus_acpi_exit(void)
acpi_bus_unregister_driver(&asus_hotk_driver);
remove_proc_entry(PROC_ASUS, acpi_root_dir);

acpi_os_free(asus_info);
kfree(asus_info);

return;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ acpi_battery_get_info(struct acpi_battery *battery,
}

end:
acpi_os_free(buffer.pointer);
kfree(buffer.pointer);

if (!result)
(*bif) = (struct acpi_battery_info *)data.pointer;
Expand Down Expand Up @@ -231,7 +231,7 @@ acpi_battery_get_status(struct acpi_battery *battery,
}

end:
acpi_os_free(buffer.pointer);
kfree(buffer.pointer);

if (!result)
(*bst) = (struct acpi_battery_status *)data.pointer;
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/container.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ container_walk_namespace_cb(acpi_handle handle,
}

end:
acpi_os_free(buffer.pointer);
kfree(buffer.pointer);

return AE_OK;
}
Expand Down
8 changes: 4 additions & 4 deletions drivers/acpi/glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ static int get_root_bridge_busnr(acpi_handle handle)
bbn = bus;
}
exit:
acpi_os_free(buffer.pointer);
kfree(buffer.pointer);
return (int)bbn;
}

Expand Down Expand Up @@ -192,7 +192,7 @@ find_pci_rootbridge(acpi_handle handle, u32 lvl, void *context, void **rv)
find->handle = handle;
status = AE_OK;
exit:
acpi_os_free(buffer.pointer);
kfree(buffer.pointer);
return status;
}

Expand Down Expand Up @@ -224,7 +224,7 @@ do_acpi_find_child(acpi_handle handle, u32 lvl, void *context, void **rv)
info = buffer.pointer;
if (info->address == find->address)
find->handle = handle;
acpi_os_free(buffer.pointer);
kfree(buffer.pointer);
}
return AE_OK;
}
Expand Down Expand Up @@ -330,7 +330,7 @@ static int acpi_platform_notify(struct device *dev)

acpi_get_name(dev->firmware_data, ACPI_FULL_PATHNAME, &buffer);
DBG("Device %s -> %s\n", dev->bus_id, (char *)buffer.pointer);
acpi_os_free(buffer.pointer);
kfree(buffer.pointer);
} else
DBG("Device %s -> No ACPI support\n", dev->bus_id);
#endif
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/namespace/nsxfeval.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ acpi_evaluate_object_typed(acpi_handle handle,

/* Caller used ACPI_ALLOCATE_BUFFER, free the return buffer */

acpi_os_free(return_buffer->pointer);
ACPI_FREE(return_buffer->pointer);
return_buffer->pointer = NULL;
}

Expand Down
9 changes: 1 addition & 8 deletions drivers/acpi/osl.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,6 @@ void *acpi_os_allocate(acpi_size size)
return kmalloc(size, GFP_KERNEL);
}

void acpi_os_free(void *ptr)
{
kfree(ptr);
}

EXPORT_SYMBOL(acpi_os_free);

acpi_status acpi_os_get_root_pointer(u32 flags, struct acpi_pointer *addr)
{
if (efi_enabled) {
Expand Down Expand Up @@ -742,7 +735,7 @@ acpi_status acpi_os_delete_semaphore(acpi_handle handle)

ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Deleting semaphore[%p].\n", handle));

acpi_os_free(sem);
kfree(sem);
sem = NULL;

return AE_OK;
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/processor_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
status = -EFAULT;

end:
acpi_os_free(buffer.pointer);
kfree(buffer.pointer);

return status;
}
Expand Down
6 changes: 3 additions & 3 deletions drivers/acpi/processor_perflib.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
sizeof(struct acpi_pct_register));

end:
acpi_os_free(buffer.pointer);
kfree(buffer.pointer);

return result;
}
Expand Down Expand Up @@ -294,7 +294,7 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
}

end:
acpi_os_free(buffer.pointer);
kfree(buffer.pointer);

return result;
}
Expand Down Expand Up @@ -592,7 +592,7 @@ static int acpi_processor_get_psd(struct acpi_processor *pr)
}

end:
acpi_os_free(buffer.pointer);
kfree(buffer.pointer);
return result;
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device)
goto end;
}

acpi_os_free(buffer.pointer);
kfree(buffer.pointer);

device->wakeup.flags.valid = 1;
/* Power button, Lid switch always enable wakeup */
Expand Down Expand Up @@ -854,7 +854,7 @@ static void acpi_device_set_id(struct acpi_device *device,
printk(KERN_ERR "Memory allocation error\n");
}

acpi_os_free(buffer.pointer);
kfree(buffer.pointer);
}

static int acpi_device_set_context(struct acpi_device *device, int type)
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ acpi_system_read_dsdt(struct file *file,

res = simple_read_from_buffer(buffer, count, ppos,
dsdt.pointer, dsdt.length);
acpi_os_free(dsdt.pointer);
kfree(dsdt.pointer);

return res;
}
Expand All @@ -113,7 +113,7 @@ acpi_system_read_fadt(struct file *file,

res = simple_read_from_buffer(buffer, count, ppos,
fadt.pointer, fadt.length);
acpi_os_free(fadt.pointer);
kfree(fadt.pointer);

return res;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/utilities/utalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ acpi_status acpi_ut_delete_caches(void)

/* Free memory lists */

acpi_os_free(acpi_gbl_global_list);
ACPI_FREE(acpi_gbl_global_list);
acpi_gbl_global_list = NULL;

acpi_os_free(acpi_gbl_ns_node_list);
ACPI_FREE(acpi_gbl_ns_node_list);
acpi_gbl_ns_node_list = NULL;
#endif

Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/utilities/utcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ acpi_status acpi_os_delete_cache(struct acpi_memory_list * cache)

/* Now we can delete the cache object */

acpi_os_free(cache);
ACPI_FREE(cache);
return (AE_OK);
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ acpi_evaluate_string(acpi_handle handle,

ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%s]\n", *data));

acpi_os_free(buffer.pointer);
kfree(buffer.pointer);

return AE_OK;
}
Expand Down Expand Up @@ -418,7 +418,7 @@ acpi_evaluate_reference(acpi_handle handle,
//kfree(list->handles);
}

acpi_os_free(buffer.pointer);
kfree(buffer.pointer);

return status;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,7 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video)
video->attached_array = active_device_list;
video->attached_count = count;
out:
acpi_os_free(buffer.pointer);
kfree(buffer.pointer);
return status;
}

Expand Down
2 changes: 1 addition & 1 deletion include/acpi/acmacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@

#define ACPI_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__)
#define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__)
#define ACPI_FREE(a) acpi_os_free(a)
#define ACPI_FREE(a) kfree(a)
#define ACPI_MEM_TRACKING(a)

#else
Expand Down
2 changes: 0 additions & 2 deletions include/acpi/acpiosxf.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,6 @@ void acpi_os_release_mutex(acpi_mutex handle);
*/
void *acpi_os_allocate(acpi_size size);

void acpi_os_free(void *memory);

acpi_status
acpi_os_map_memory(acpi_physical_address physical_address,
acpi_size size, void __iomem ** logical_address);
Expand Down

0 comments on commit b197ba3

Please sign in to comment.