void acpi_ps_delete_parse_tree ( union acpi_parse_object *subtree_root) { struct acpi_walk_state *walk_state; struct acpi_thread_state *thread; acpi_status status; ACPI_FUNCTION_TRACE_PTR ("ps_delete_parse_tree", subtree_root); if (!subtree_root) { return_VOID; } /* Create and initialize a new walk list */ thread = acpi_ut_create_thread_state (); if (!thread) { return_VOID; } walk_state = acpi_ds_create_walk_state (0, NULL, NULL, thread); if (!walk_state) { return_VOID; } walk_state->parse_flags = 0; walk_state->descending_callback = NULL; walk_state->ascending_callback = NULL; walk_state->origin = subtree_root; walk_state->next_op = subtree_root; /* Head downward in the tree */ walk_state->next_op_info = ACPI_NEXT_OP_DOWNWARD; /* Visit all nodes in the subtree */ while (walk_state->next_op) { status = acpi_ps_get_next_walk_op (walk_state, walk_state->next_op, acpi_ps_delete_completed_op); if (ACPI_FAILURE (status)) { break; } } /* We are done with this walk */ acpi_ut_delete_generic_state (ACPI_CAST_PTR (union acpi_generic_state, thread)); acpi_ds_delete_walk_state (walk_state); return_VOID; }
void acpi_ps_delete_parse_tree ( ACPI_PARSE_OBJECT *subtree_root) { ACPI_WALK_STATE *walk_state; ACPI_WALK_LIST walk_list; if (!subtree_root) { return; } /* Create and initialize a new walk list */ walk_list.walk_state = NULL; walk_state = acpi_ds_create_walk_state (TABLE_ID_DSDT, NULL, NULL, &walk_list); if (!walk_state) { return; } walk_state->parser_state = NULL; walk_state->parse_flags = 0; walk_state->descending_callback = NULL; walk_state->ascending_callback = NULL; walk_state->origin = subtree_root; walk_state->next_op = subtree_root; /* Head downward in the tree */ walk_state->next_op_info = NEXT_OP_DOWNWARD; /* Visit all nodes in the subtree */ while (walk_state->next_op) { acpi_ps_get_next_walk_op (walk_state, walk_state->next_op, acpi_ps_delete_completed_op); } /* We are done with this walk */ acpi_ds_delete_walk_state (walk_state); return; }