summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/dispatcher
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/dispatcher')
-rw-r--r--drivers/acpi/dispatcher/dsinit.c24
-rw-r--r--drivers/acpi/dispatcher/dsmethod.c34
-rw-r--r--drivers/acpi/dispatcher/dswstate.c4
3 files changed, 29 insertions, 33 deletions
diff --git a/drivers/acpi/dispatcher/dsinit.c b/drivers/acpi/dispatcher/dsinit.c
index ebc07aab710..bcd1d472b90 100644
--- a/drivers/acpi/dispatcher/dsinit.c
+++ b/drivers/acpi/dispatcher/dsinit.c
@@ -86,20 +86,20 @@ acpi_ds_init_one_object (
void *context,
void **return_value)
{
+ struct acpi_init_walk_info *info = (struct acpi_init_walk_info *) context;
+ struct acpi_namespace_node *node = (struct acpi_namespace_node *) obj_handle;
acpi_object_type type;
acpi_status status;
- struct acpi_init_walk_info *info = (struct acpi_init_walk_info *) context;
ACPI_FUNCTION_NAME ("ds_init_one_object");
/*
- * We are only interested in objects owned by the table that
+ * We are only interested in NS nodes owned by the table that
* was just loaded
*/
- if (((struct acpi_namespace_node *) obj_handle)->owner_id !=
- info->table_desc->owner_id) {
+ if (node->owner_id != info->table_desc->owner_id) {
return (AE_OK);
}
@@ -126,8 +126,6 @@ acpi_ds_init_one_object (
case ACPI_TYPE_METHOD:
- info->method_count++;
-
/*
* Print a dot for each method unless we are going to print
* the entire pathname
@@ -143,7 +141,7 @@ acpi_ds_init_one_object (
* on a per-table basis. Currently, we just use a global for the width.
*/
if (info->table_desc->pointer->revision == 1) {
- ((struct acpi_namespace_node *) obj_handle)->flags |= ANOBJ_DATA_WIDTH_32;
+ node->flags |= ANOBJ_DATA_WIDTH_32;
}
/*
@@ -153,22 +151,14 @@ acpi_ds_init_one_object (
status = acpi_ds_parse_method (obj_handle);
if (ACPI_FAILURE (status)) {
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
- "Method %p [%4.4s] - parse failure, %s\n",
+ "\n+Method %p [%4.4s] - parse failure, %s\n",
obj_handle, acpi_ut_get_node_name (obj_handle),
acpi_format_exception (status)));
/* This parse failed, but we will continue parsing more methods */
-
- break;
}
- /*
- * Delete the parse tree. We simply re-parse the method
- * for every execution since there isn't much overhead
- */
- acpi_ns_delete_namespace_subtree (obj_handle);
- acpi_ns_delete_namespace_by_owner (
- ((struct acpi_namespace_node *) obj_handle)->object->method.owner_id);
+ info->method_count++;
break;
diff --git a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c
index 1b90813cbde..e344c06ed33 100644
--- a/drivers/acpi/dispatcher/dsmethod.c
+++ b/drivers/acpi/dispatcher/dsmethod.c
@@ -58,12 +58,11 @@
*
* FUNCTION: acpi_ds_parse_method
*
- * PARAMETERS: obj_handle - Method node
+ * PARAMETERS: Node - Method node
*
* RETURN: Status
*
- * DESCRIPTION: Call the parser and parse the AML that is associated with the
- * method.
+ * DESCRIPTION: Parse the AML that is associated with the method.
*
* MUTEX: Assumes parser is locked
*
@@ -71,30 +70,28 @@
acpi_status
acpi_ds_parse_method (
- acpi_handle obj_handle)
+ struct acpi_namespace_node *node)
{
acpi_status status;
union acpi_operand_object *obj_desc;
union acpi_parse_object *op;
- struct acpi_namespace_node *node;
struct acpi_walk_state *walk_state;
- ACPI_FUNCTION_TRACE_PTR ("ds_parse_method", obj_handle);
+ ACPI_FUNCTION_TRACE_PTR ("ds_parse_method", node);
/* Parameter Validation */
- if (!obj_handle) {
+ if (!node) {
return_ACPI_STATUS (AE_NULL_ENTRY);
}
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Parsing [%4.4s] **** named_obj=%p\n",
- acpi_ut_get_node_name (obj_handle), obj_handle));
+ acpi_ut_get_node_name (node), node));
/* Extract the method object from the method Node */
- node = (struct acpi_namespace_node *) obj_handle;
obj_desc = acpi_ns_get_attached_object (node);
if (!obj_desc) {
return_ACPI_STATUS (AE_NULL_OBJECT);
@@ -169,10 +166,18 @@ acpi_ds_parse_method (
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"**** [%4.4s] Parsed **** named_obj=%p Op=%p\n",
- acpi_ut_get_node_name (obj_handle), obj_handle, op));
+ acpi_ut_get_node_name (node), node, op));
+
+ /*
+ * Delete the parse tree. We simply re-parse the method for every
+ * execution since there isn't much overhead (compared to keeping lots
+ * of parse trees around)
+ */
+ acpi_ns_delete_namespace_subtree (node);
+ acpi_ns_delete_namespace_by_owner (obj_desc->method.owner_id);
cleanup2:
- (void) acpi_ut_release_owner_id (obj_desc->method.owner_id);
+ acpi_ut_release_owner_id (&obj_desc->method.owner_id);
cleanup:
acpi_ps_delete_parse_tree (op);
@@ -391,7 +396,7 @@ acpi_ds_call_control_method (
/* On error, we must delete the new walk state */
cleanup:
- (void) acpi_ut_release_owner_id (obj_desc->method.owner_id);
+ acpi_ut_release_owner_id (&obj_desc->method.owner_id);
if (next_walk_state && (next_walk_state->method_desc)) {
/* Decrement the thread count on the method parse tree */
@@ -563,8 +568,7 @@ acpi_ds_terminate_control_method (
*/
if ((walk_state->method_desc->method.concurrency == 1) &&
(!walk_state->method_desc->method.semaphore)) {
- status = acpi_os_create_semaphore (1,
- 1,
+ status = acpi_os_create_semaphore (1, 1,
&walk_state->method_desc->method.semaphore);
}
@@ -595,6 +599,8 @@ acpi_ds_terminate_control_method (
*/
acpi_ns_delete_namespace_by_owner (walk_state->method_desc->method.owner_id);
status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
+ acpi_ut_release_owner_id (&walk_state->method_desc->method.owner_id);
+
if (ACPI_FAILURE (status)) {
return_ACPI_STATUS (status);
}
diff --git a/drivers/acpi/dispatcher/dswstate.c b/drivers/acpi/dispatcher/dswstate.c
index d360d8e8954..5621665991b 100644
--- a/drivers/acpi/dispatcher/dswstate.c
+++ b/drivers/acpi/dispatcher/dswstate.c
@@ -744,7 +744,7 @@ acpi_ds_init_aml_walk (
u8 *aml_start,
u32 aml_length,
struct acpi_parameter_info *info,
- u32 pass_number)
+ u8 pass_number)
{
acpi_status status;
struct acpi_parse_state *parser_state = &walk_state->parser_state;
@@ -762,7 +762,7 @@ acpi_ds_init_aml_walk (
/* The next_op of the next_walk will be the beginning of the method */
walk_state->next_op = NULL;
- walk_state->pass_number = (u8) pass_number;
+ walk_state->pass_number = pass_number;
if (info) {
if (info->parameter_type == ACPI_PARAM_GPE) {