aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/namespace/nswalk.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/namespace/nswalk.c')
-rw-r--r--drivers/acpi/namespace/nswalk.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/acpi/namespace/nswalk.c b/drivers/acpi/namespace/nswalk.c
index c8f6bef16ed0..a138fcb832a3 100644
--- a/drivers/acpi/namespace/nswalk.c
+++ b/drivers/acpi/namespace/nswalk.c
@@ -126,7 +126,7 @@ struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type,
126 * PARAMETERS: Type - acpi_object_type to search for 126 * PARAMETERS: Type - acpi_object_type to search for
127 * start_node - Handle in namespace where search begins 127 * start_node - Handle in namespace where search begins
128 * max_depth - Depth to which search is to reach 128 * max_depth - Depth to which search is to reach
129 * unlock_before_callback- Whether to unlock the NS before invoking 129 * Flags - Whether to unlock the NS before invoking
130 * the callback routine 130 * the callback routine
131 * user_function - Called when an object of "Type" is found 131 * user_function - Called when an object of "Type" is found
132 * Context - Passed to user function 132 * Context - Passed to user function
@@ -153,7 +153,7 @@ acpi_status
153acpi_ns_walk_namespace(acpi_object_type type, 153acpi_ns_walk_namespace(acpi_object_type type,
154 acpi_handle start_node, 154 acpi_handle start_node,
155 u32 max_depth, 155 u32 max_depth,
156 u8 unlock_before_callback, 156 u32 flags,
157 acpi_walk_callback user_function, 157 acpi_walk_callback user_function,
158 void *context, void **return_value) 158 void *context, void **return_value)
159{ 159{
@@ -201,12 +201,15 @@ acpi_ns_walk_namespace(acpi_object_type type,
201 child_type = child_node->type; 201 child_type = child_node->type;
202 } 202 }
203 203
204 if (child_type == type) { 204 if ((child_type == type) &&
205 (!(child_node->flags & ANOBJ_TEMPORARY) ||
206 (child_node->flags & ANOBJ_TEMPORARY)
207 && (flags & ACPI_NS_WALK_TEMP_NODES))) {
205 /* 208 /*
206 * Found a matching node, invoke the user 209 * Found a matching node, invoke the user
207 * callback function 210 * callback function
208 */ 211 */
209 if (unlock_before_callback) { 212 if (flags & ACPI_NS_WALK_UNLOCK) {
210 mutex_status = 213 mutex_status =
211 acpi_ut_release_mutex 214 acpi_ut_release_mutex
212 (ACPI_MTX_NAMESPACE); 215 (ACPI_MTX_NAMESPACE);
@@ -219,7 +222,7 @@ acpi_ns_walk_namespace(acpi_object_type type,
219 status = user_function(child_node, level, 222 status = user_function(child_node, level,
220 context, return_value); 223 context, return_value);
221 224
222 if (unlock_before_callback) { 225 if (flags & ACPI_NS_WALK_UNLOCK) {
223 mutex_status = 226 mutex_status =
224 acpi_ut_acquire_mutex 227 acpi_ut_acquire_mutex
225 (ACPI_MTX_NAMESPACE); 228 (ACPI_MTX_NAMESPACE);