Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165193
b: refs/heads/master
c: 8e4319c
h: refs/heads/master
i:
  165191: 3d3f478
v: v3
  • Loading branch information
Bob Moore authored and Len Brown committed Aug 27, 2009
1 parent e26f291 commit 5848e3a
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 36 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6557a49a443a347d24aed58076365432ded30edc
refs/heads/master: 8e4319c425077c4cc540696a5bb6c4d12f017dcd
2 changes: 2 additions & 0 deletions trunk/drivers/acpi/acpica/acnamesp.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ struct acpi_namespace_node *acpi_ns_create_node(u32 name);

void acpi_ns_delete_node(struct acpi_namespace_node *node);

void acpi_ns_remove_node(struct acpi_namespace_node *node);

void
acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_handle);

Expand Down
88 changes: 61 additions & 27 deletions trunk/drivers/acpi/acpica/nsalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,68 @@ struct acpi_namespace_node *acpi_ns_create_node(u32 name)
*
* RETURN: None
*
* DESCRIPTION: Delete a namespace node
* DESCRIPTION: Delete a namespace node. All node deletions must come through
* here. Detaches any attached objects, including any attached
* data. If a handler is associated with attached data, it is
* invoked before the node is deleted.
*
******************************************************************************/

void acpi_ns_delete_node(struct acpi_namespace_node *node)
{
union acpi_operand_object *obj_desc;

ACPI_FUNCTION_NAME(ns_delete_node);

/* Detach an object if there is one */

acpi_ns_detach_object(node);

/*
* Delete an attached data object if present (an object that was created
* and attached via acpi_attach_data). Note: After any normal object is
* detached above, the only possible remaining object is a data object.
*/
obj_desc = node->object;
if (obj_desc && (obj_desc->common.type == ACPI_TYPE_LOCAL_DATA)) {

/* Invoke the attached data deletion handler if present */

if (obj_desc->data.handler) {
obj_desc->data.handler(node, obj_desc->data.pointer);
}

acpi_ut_remove_reference(obj_desc);
}

/* Now we can delete the node */

(void)acpi_os_release_object(acpi_gbl_namespace_cache, node);

ACPI_MEM_TRACKING(acpi_gbl_ns_node_list->total_freed++);
ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "Node %p, Remaining %X\n",
node, acpi_gbl_current_node_count));
}

/*******************************************************************************
*
* FUNCTION: acpi_ns_remove_node
*
* PARAMETERS: Node - Node to be removed/deleted
*
* RETURN: None
*
* DESCRIPTION: Remove (unlink) and delete a namespace node
*
******************************************************************************/

void acpi_ns_remove_node(struct acpi_namespace_node *node)
{
struct acpi_namespace_node *parent_node;
struct acpi_namespace_node *prev_node;
struct acpi_namespace_node *next_node;

ACPI_FUNCTION_TRACE_PTR(ns_delete_node, node);
ACPI_FUNCTION_TRACE_PTR(ns_remove_node, node);

parent_node = acpi_ns_get_parent_node(node);

Expand Down Expand Up @@ -142,12 +193,9 @@ void acpi_ns_delete_node(struct acpi_namespace_node *node)
}
}

ACPI_MEM_TRACKING(acpi_gbl_ns_node_list->total_freed++);

/* Detach an object if there is one, then delete the node */
/* Delete the node and any attached objects */

acpi_ns_detach_object(node);
(void)acpi_os_release_object(acpi_gbl_namespace_cache, node);
acpi_ns_delete_node(node);
return_VOID;
}

Expand Down Expand Up @@ -273,25 +321,11 @@ void acpi_ns_delete_children(struct acpi_namespace_node *parent_node)
parent_node, child_node));
}

/* Now we can free this child object */

ACPI_MEM_TRACKING(acpi_gbl_ns_node_list->total_freed++);

ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
"Object %p, Remaining %X\n", child_node,
acpi_gbl_current_node_count));

/* Detach an object if there is one, then free the child node */

acpi_ns_detach_object(child_node);

/* Now we can delete the node */

(void)acpi_os_release_object(acpi_gbl_namespace_cache,
child_node);

/* And move on to the next child in the list */

/*
* Delete this child node and move on to the next child in the list.
* No need to unlink the node since we are deleting the entire branch.
*/
acpi_ns_delete_node(child_node);
child_node = next_node;

} while (!(flags & ANOBJ_END_OF_PEER_LIST));
Expand Down Expand Up @@ -433,7 +467,7 @@ void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id)

if (deletion_node) {
acpi_ns_delete_children(deletion_node);
acpi_ns_delete_node(deletion_node);
acpi_ns_remove_node(deletion_node);
deletion_node = NULL;
}

Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/acpi/acpica/nsload.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,7 @@ static acpi_status acpi_ns_delete_subtree(acpi_handle start_handle)

/* Now delete the starting object, and we are done */

acpi_ns_delete_node(child_handle);

acpi_ns_remove_node(child_handle);
return_ACPI_STATUS(AE_OK);
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/acpi/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ int acpi_bus_get_status(struct acpi_device *device)
EXPORT_SYMBOL(acpi_bus_get_status);

void acpi_bus_private_data_handler(acpi_handle handle,
u32 function, void *context)
void *context)
{
return;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/acpi/glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ EXPORT_SYMBOL(acpi_get_child);

/* Link ACPI devices with physical devices */
static void acpi_glue_data_handler(acpi_handle handle,
u32 function, void *context)
void *context)
{
/* we provide an empty handler */
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ acpi_bus_get_ejd(acpi_handle handle, acpi_handle *ejd)
}
EXPORT_SYMBOL_GPL(acpi_bus_get_ejd);

void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context)
void acpi_bus_data_handler(acpi_handle handle, void *context)
{

/* TBD */
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/acpi/acpi_bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ struct acpi_bus_event {

extern struct kobject *acpi_kobj;
extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int);
void acpi_bus_private_data_handler(acpi_handle, u32, void *);
void acpi_bus_private_data_handler(acpi_handle, void *);
int acpi_bus_get_private_data(acpi_handle, void **);
extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32);
extern int register_acpi_notifier(struct notifier_block *);
Expand All @@ -325,7 +325,7 @@ extern void unregister_acpi_bus_notifier(struct notifier_block *nb);
*/

int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device);
void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context);
void acpi_bus_data_handler(acpi_handle handle, void *context);
int acpi_bus_get_status(struct acpi_device *device);
int acpi_bus_get_power(acpi_handle handle, int *state);
int acpi_bus_set_power(acpi_handle handle, int state);
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/acpi/actypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ typedef
void (*acpi_notify_handler) (acpi_handle device, u32 value, void *context);

typedef
void (*acpi_object_handler) (acpi_handle object, u32 function, void *data);
void (*acpi_object_handler) (acpi_handle object, void *data);

typedef acpi_status(*acpi_init_handler) (acpi_handle object, u32 function);

Expand Down

0 comments on commit 5848e3a

Please sign in to comment.