diff options
Diffstat (limited to 'drivers/acpi/parser/pstree.c')
-rw-r--r-- | drivers/acpi/parser/pstree.c | 159 |
1 files changed, 83 insertions, 76 deletions
diff --git a/drivers/acpi/parser/pstree.c b/drivers/acpi/parser/pstree.c index 2140bd1ac10b..d5aafe73fca0 100644 --- a/drivers/acpi/parser/pstree.c +++ b/drivers/acpi/parser/pstree.c @@ -49,6 +49,14 @@ #define _COMPONENT ACPI_PARSER ACPI_MODULE_NAME ("pstree") +/* Local prototypes */ + +#ifdef ACPI_OBSOLETE_FUNCTIONS +union acpi_parse_object * +acpi_ps_get_child ( + union acpi_parse_object *op); +#endif + /******************************************************************************* * @@ -57,7 +65,7 @@ * PARAMETERS: Op - Get an argument for this op * Argn - Nth argument to get * - * RETURN: The argument (as an Op object). NULL if argument does not exist + * RETURN: The argument (as an Op object). NULL if argument does not exist * * DESCRIPTION: Get the specified op's argument. * @@ -152,7 +160,6 @@ acpi_ps_append_arg ( return; } - /* Append the argument to the linked argument list */ if (op->common.value.arg) { @@ -164,14 +171,12 @@ acpi_ps_append_arg ( } prev_arg->common.next = arg; } - else { /* No argument list, this will be the first argument */ op->common.value.arg = arg; } - /* Set the parent in this arg and any args linked after it */ while (arg) { @@ -182,73 +187,6 @@ acpi_ps_append_arg ( #ifdef ACPI_FUTURE_USAGE - -/******************************************************************************* - * - * FUNCTION: acpi_ps_get_child - * - * PARAMETERS: Op - Get the child of this Op - * - * RETURN: Child Op, Null if none is found. - * - * DESCRIPTION: Get op's children or NULL if none - * - ******************************************************************************/ -union acpi_parse_object * -acpi_ps_get_child ( - union acpi_parse_object *op) -{ - union acpi_parse_object *child = NULL; - - - ACPI_FUNCTION_ENTRY (); - - - switch (op->common.aml_opcode) { - case AML_SCOPE_OP: - case AML_ELSE_OP: - case AML_DEVICE_OP: - case AML_THERMAL_ZONE_OP: - case AML_INT_METHODCALL_OP: - - child = acpi_ps_get_arg (op, 0); - break; - - - case AML_BUFFER_OP: - case AML_PACKAGE_OP: - case AML_METHOD_OP: - case AML_IF_OP: - case AML_WHILE_OP: - case AML_FIELD_OP: - - child = acpi_ps_get_arg (op, 1); - break; - - - case AML_POWER_RES_OP: - case AML_INDEX_FIELD_OP: - - child = acpi_ps_get_arg (op, 2); - break; - - - case AML_PROCESSOR_OP: - case AML_BANK_FIELD_OP: - - child = acpi_ps_get_arg (op, 3); - break; - - - default: - /* All others have no children */ - break; - } - - return (child); -} - - /******************************************************************************* * * FUNCTION: acpi_ps_get_depth_next @@ -280,21 +218,21 @@ acpi_ps_get_depth_next ( return (NULL); } - /* look for an argument or child */ + /* Look for an argument or child */ next = acpi_ps_get_arg (op, 0); if (next) { return (next); } - /* look for a sibling */ + /* Look for a sibling */ next = op->common.next; if (next) { return (next); } - /* look for a sibling of parent */ + /* Look for a sibling of parent */ parent = op->common.parent; @@ -305,13 +243,13 @@ acpi_ps_get_depth_next ( } if (arg == origin) { - /* reached parent of origin, end search */ + /* Reached parent of origin, end search */ return (NULL); } if (parent->common.next) { - /* found sibling of parent */ + /* Found sibling of parent */ return (parent->common.next); } @@ -323,5 +261,74 @@ acpi_ps_get_depth_next ( return (next); } + +#ifdef ACPI_OBSOLETE_FUNCTIONS +/******************************************************************************* + * + * FUNCTION: acpi_ps_get_child + * + * PARAMETERS: Op - Get the child of this Op + * + * RETURN: Child Op, Null if none is found. + * + * DESCRIPTION: Get op's children or NULL if none + * + ******************************************************************************/ + +union acpi_parse_object * +acpi_ps_get_child ( + union acpi_parse_object *op) +{ + union acpi_parse_object *child = NULL; + + + ACPI_FUNCTION_ENTRY (); + + + switch (op->common.aml_opcode) { + case AML_SCOPE_OP: + case AML_ELSE_OP: + case AML_DEVICE_OP: + case AML_THERMAL_ZONE_OP: + case AML_INT_METHODCALL_OP: + + child = acpi_ps_get_arg (op, 0); + break; + + + case AML_BUFFER_OP: + case AML_PACKAGE_OP: + case AML_METHOD_OP: + case AML_IF_OP: + case AML_WHILE_OP: + case AML_FIELD_OP: + + child = acpi_ps_get_arg (op, 1); + break; + + + case AML_POWER_RES_OP: + case AML_INDEX_FIELD_OP: + + child = acpi_ps_get_arg (op, 2); + break; + + + case AML_PROCESSOR_OP: + case AML_BANK_FIELD_OP: + + child = acpi_ps_get_arg (op, 3); + break; + + + default: + /* All others have no children */ + break; + } + + return (child); +} +#endif + #endif /* ACPI_FUTURE_USAGE */ |