Loading drivers/acpi/acpica/acnamesp.h +11 −2 Original line number Diff line number Diff line Loading @@ -99,8 +99,17 @@ acpi_ns_walk_namespace(acpi_object_type type, acpi_walk_callback user_function, void *context, void **return_value); struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type, struct acpi_namespace_node *parent, struct acpi_namespace_node struct acpi_namespace_node *acpi_ns_get_next_node(struct acpi_namespace_node *parent, struct acpi_namespace_node *child); struct acpi_namespace_node *acpi_ns_get_next_node_typed(acpi_object_type type, struct acpi_namespace_node *parent, struct acpi_namespace_node *child); /* Loading drivers/acpi/acpica/nsalloc.c +4 −10 Original line number Diff line number Diff line Loading @@ -334,9 +334,7 @@ void acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_node) /* Get the next node in this scope (NULL if none) */ child_node = acpi_ns_get_next_node(ACPI_TYPE_ANY, parent_node, child_node); child_node = acpi_ns_get_next_node(parent_node, child_node); if (child_node) { /* Found a child node - detach any attached object */ Loading @@ -345,8 +343,7 @@ void acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_node) /* Check if this node has any children */ if (acpi_ns_get_next_node (ACPI_TYPE_ANY, child_node, NULL)) { if (child_node->child) { /* * There is at least one child of this node, * visit the node Loading Loading @@ -432,9 +429,7 @@ void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id) * Get the next child of this parent node. When child_node is NULL, * the first child of the parent is returned */ child_node = acpi_ns_get_next_node(ACPI_TYPE_ANY, parent_node, child_node); child_node = acpi_ns_get_next_node(parent_node, child_node); if (deletion_node) { acpi_ns_delete_children(deletion_node); Loading @@ -452,8 +447,7 @@ void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id) /* Check if this node has any children */ if (acpi_ns_get_next_node (ACPI_TYPE_ANY, child_node, NULL)) { if (child_node->child) { /* * There is at least one child of this node, * visit the node Loading drivers/acpi/acpica/nswalk.c +53 −16 Original line number Diff line number Diff line Loading @@ -52,8 +52,7 @@ ACPI_MODULE_NAME("nswalk") * * FUNCTION: acpi_ns_get_next_node * * PARAMETERS: Type - Type of node to be searched for * parent_node - Parent node whose children we are * PARAMETERS: parent_node - Parent node whose children we are * getting * child_node - Previous child that was found. * The NEXT child will be returned Loading @@ -66,27 +65,68 @@ ACPI_MODULE_NAME("nswalk") * within Scope is returned. * ******************************************************************************/ struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type, struct acpi_namespace_node *parent_node, struct acpi_namespace_node struct acpi_namespace_node *acpi_ns_get_next_node(struct acpi_namespace_node *parent_node, struct acpi_namespace_node *child_node) { struct acpi_namespace_node *next_node = NULL; ACPI_FUNCTION_ENTRY(); if (!child_node) { /* It's really the parent's _scope_ that we want */ next_node = parent_node->child; return parent_node->child; } /* * Get the next node. * * If we are at the end of this peer list, return NULL */ if (child_node->flags & ANOBJ_END_OF_PEER_LIST) { return NULL; } else { /* Start search at the NEXT node */ /* Otherwise just return the next peer */ next_node = acpi_ns_get_next_valid_node(child_node); return child_node->peer; } /******************************************************************************* * * FUNCTION: acpi_ns_get_next_node_typed * * PARAMETERS: Type - Type of node to be searched for * parent_node - Parent node whose children we are * getting * child_node - Previous child that was found. * The NEXT child will be returned * * RETURN: struct acpi_namespace_node - Pointer to the NEXT child or NULL if * none is found. * * DESCRIPTION: Return the next peer node within the namespace. If Handle * is valid, Scope is ignored. Otherwise, the first node * within Scope is returned. * ******************************************************************************/ struct acpi_namespace_node *acpi_ns_get_next_node_typed(acpi_object_type type, struct acpi_namespace_node *parent_node, struct acpi_namespace_node *child_node) { struct acpi_namespace_node *next_node = NULL; ACPI_FUNCTION_ENTRY(); next_node = acpi_ns_get_next_node(parent_node, child_node); /* If any type is OK, we are done */ if (type == ACPI_TYPE_ANY) { Loading Loading @@ -186,9 +226,7 @@ acpi_ns_walk_namespace(acpi_object_type type, /* Get the next node in this scope. Null if not found */ status = AE_OK; child_node = acpi_ns_get_next_node(ACPI_TYPE_ANY, parent_node, child_node); child_node = acpi_ns_get_next_node(parent_node, child_node); if (child_node) { /* Found next child, get the type if we are not searching for ANY */ Loading Loading @@ -269,8 +307,7 @@ acpi_ns_walk_namespace(acpi_object_type type, * function has specified that the maximum depth has been reached. */ if ((level < max_depth) && (status != AE_CTRL_DEPTH)) { if (acpi_ns_get_next_node (ACPI_TYPE_ANY, child_node, NULL)) { if (child_node->child) { /* There is at least one child of this node, visit it */ Loading drivers/acpi/acpica/nsxfobj.c +1 −1 Original line number Diff line number Diff line Loading @@ -268,7 +268,7 @@ acpi_get_next_object(acpi_object_type type, /* Internal function does the real work */ node = acpi_ns_get_next_node(type, parent_node, child_node); node = acpi_ns_get_next_node_typed(type, parent_node, child_node); if (!node) { status = AE_NOT_FOUND; goto unlock_and_exit; Loading Loading
drivers/acpi/acpica/acnamesp.h +11 −2 Original line number Diff line number Diff line Loading @@ -99,8 +99,17 @@ acpi_ns_walk_namespace(acpi_object_type type, acpi_walk_callback user_function, void *context, void **return_value); struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type, struct acpi_namespace_node *parent, struct acpi_namespace_node struct acpi_namespace_node *acpi_ns_get_next_node(struct acpi_namespace_node *parent, struct acpi_namespace_node *child); struct acpi_namespace_node *acpi_ns_get_next_node_typed(acpi_object_type type, struct acpi_namespace_node *parent, struct acpi_namespace_node *child); /* Loading
drivers/acpi/acpica/nsalloc.c +4 −10 Original line number Diff line number Diff line Loading @@ -334,9 +334,7 @@ void acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_node) /* Get the next node in this scope (NULL if none) */ child_node = acpi_ns_get_next_node(ACPI_TYPE_ANY, parent_node, child_node); child_node = acpi_ns_get_next_node(parent_node, child_node); if (child_node) { /* Found a child node - detach any attached object */ Loading @@ -345,8 +343,7 @@ void acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_node) /* Check if this node has any children */ if (acpi_ns_get_next_node (ACPI_TYPE_ANY, child_node, NULL)) { if (child_node->child) { /* * There is at least one child of this node, * visit the node Loading Loading @@ -432,9 +429,7 @@ void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id) * Get the next child of this parent node. When child_node is NULL, * the first child of the parent is returned */ child_node = acpi_ns_get_next_node(ACPI_TYPE_ANY, parent_node, child_node); child_node = acpi_ns_get_next_node(parent_node, child_node); if (deletion_node) { acpi_ns_delete_children(deletion_node); Loading @@ -452,8 +447,7 @@ void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id) /* Check if this node has any children */ if (acpi_ns_get_next_node (ACPI_TYPE_ANY, child_node, NULL)) { if (child_node->child) { /* * There is at least one child of this node, * visit the node Loading
drivers/acpi/acpica/nswalk.c +53 −16 Original line number Diff line number Diff line Loading @@ -52,8 +52,7 @@ ACPI_MODULE_NAME("nswalk") * * FUNCTION: acpi_ns_get_next_node * * PARAMETERS: Type - Type of node to be searched for * parent_node - Parent node whose children we are * PARAMETERS: parent_node - Parent node whose children we are * getting * child_node - Previous child that was found. * The NEXT child will be returned Loading @@ -66,27 +65,68 @@ ACPI_MODULE_NAME("nswalk") * within Scope is returned. * ******************************************************************************/ struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type, struct acpi_namespace_node *parent_node, struct acpi_namespace_node struct acpi_namespace_node *acpi_ns_get_next_node(struct acpi_namespace_node *parent_node, struct acpi_namespace_node *child_node) { struct acpi_namespace_node *next_node = NULL; ACPI_FUNCTION_ENTRY(); if (!child_node) { /* It's really the parent's _scope_ that we want */ next_node = parent_node->child; return parent_node->child; } /* * Get the next node. * * If we are at the end of this peer list, return NULL */ if (child_node->flags & ANOBJ_END_OF_PEER_LIST) { return NULL; } else { /* Start search at the NEXT node */ /* Otherwise just return the next peer */ next_node = acpi_ns_get_next_valid_node(child_node); return child_node->peer; } /******************************************************************************* * * FUNCTION: acpi_ns_get_next_node_typed * * PARAMETERS: Type - Type of node to be searched for * parent_node - Parent node whose children we are * getting * child_node - Previous child that was found. * The NEXT child will be returned * * RETURN: struct acpi_namespace_node - Pointer to the NEXT child or NULL if * none is found. * * DESCRIPTION: Return the next peer node within the namespace. If Handle * is valid, Scope is ignored. Otherwise, the first node * within Scope is returned. * ******************************************************************************/ struct acpi_namespace_node *acpi_ns_get_next_node_typed(acpi_object_type type, struct acpi_namespace_node *parent_node, struct acpi_namespace_node *child_node) { struct acpi_namespace_node *next_node = NULL; ACPI_FUNCTION_ENTRY(); next_node = acpi_ns_get_next_node(parent_node, child_node); /* If any type is OK, we are done */ if (type == ACPI_TYPE_ANY) { Loading Loading @@ -186,9 +226,7 @@ acpi_ns_walk_namespace(acpi_object_type type, /* Get the next node in this scope. Null if not found */ status = AE_OK; child_node = acpi_ns_get_next_node(ACPI_TYPE_ANY, parent_node, child_node); child_node = acpi_ns_get_next_node(parent_node, child_node); if (child_node) { /* Found next child, get the type if we are not searching for ANY */ Loading Loading @@ -269,8 +307,7 @@ acpi_ns_walk_namespace(acpi_object_type type, * function has specified that the maximum depth has been reached. */ if ((level < max_depth) && (status != AE_CTRL_DEPTH)) { if (acpi_ns_get_next_node (ACPI_TYPE_ANY, child_node, NULL)) { if (child_node->child) { /* There is at least one child of this node, visit it */ Loading
drivers/acpi/acpica/nsxfobj.c +1 −1 Original line number Diff line number Diff line Loading @@ -268,7 +268,7 @@ acpi_get_next_object(acpi_object_type type, /* Internal function does the real work */ node = acpi_ns_get_next_node(type, parent_node, child_node); node = acpi_ns_get_next_node_typed(type, parent_node, child_node); if (!node) { status = AE_NOT_FOUND; goto unlock_and_exit; Loading