diff options
author | Bob Moore <robert.moore@intel.com> | 2007-02-02 11:48:21 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-02-02 21:14:28 -0500 |
commit | 3effba32069514e56bcb778f90cd34fdbac79a50 (patch) | |
tree | c47438b1047cdfa3e03bc412eacf45aae5bac73f /drivers/acpi/namespace/nswalk.c | |
parent | ec3153fb0e96988dc7e378b3ab01e05131ba713b (diff) |
ACPICA: Update comments
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/namespace/nswalk.c')
-rw-r--r-- | drivers/acpi/namespace/nswalk.c | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/drivers/acpi/namespace/nswalk.c b/drivers/acpi/namespace/nswalk.c index a138fcb832a3..c6619d8a5164 100644 --- a/drivers/acpi/namespace/nswalk.c +++ b/drivers/acpi/namespace/nswalk.c | |||
@@ -193,21 +193,28 @@ acpi_ns_walk_namespace(acpi_object_type type, | |||
193 | acpi_ns_get_next_node(ACPI_TYPE_ANY, parent_node, | 193 | acpi_ns_get_next_node(ACPI_TYPE_ANY, parent_node, |
194 | child_node); | 194 | child_node); |
195 | if (child_node) { | 195 | if (child_node) { |
196 | /* | 196 | |
197 | * Found node, Get the type if we are not | 197 | /* Found node, Get the type if we are not searching for ANY */ |
198 | * searching for ANY | 198 | |
199 | */ | ||
200 | if (type != ACPI_TYPE_ANY) { | 199 | if (type != ACPI_TYPE_ANY) { |
201 | child_type = child_node->type; | 200 | child_type = child_node->type; |
202 | } | 201 | } |
203 | 202 | ||
203 | /* | ||
204 | * 1) Type must match | ||
205 | * 2) Permanent namespace nodes are OK | ||
206 | * 3) Ignore temporary nodes unless told otherwise. Typically, | ||
207 | * the temporary nodes can cause a race condition where they can | ||
208 | * be deleted during the execution of the user function. Only the | ||
209 | * debugger namespace dump will examine the temporary nodes. | ||
210 | */ | ||
204 | if ((child_type == type) && | 211 | if ((child_type == type) && |
205 | (!(child_node->flags & ANOBJ_TEMPORARY) || | 212 | (!(child_node->flags & ANOBJ_TEMPORARY) || |
206 | (child_node->flags & ANOBJ_TEMPORARY) | 213 | (child_node->flags & ANOBJ_TEMPORARY) |
207 | && (flags & ACPI_NS_WALK_TEMP_NODES))) { | 214 | && (flags & ACPI_NS_WALK_TEMP_NODES))) { |
208 | /* | 215 | /* |
209 | * Found a matching node, invoke the user | 216 | * Found a matching node, invoke the user callback function. |
210 | * callback function | 217 | * Unlock the namespace if flag is set. |
211 | */ | 218 | */ |
212 | if (flags & ACPI_NS_WALK_UNLOCK) { | 219 | if (flags & ACPI_NS_WALK_UNLOCK) { |
213 | mutex_status = | 220 | mutex_status = |
@@ -219,8 +226,9 @@ acpi_ns_walk_namespace(acpi_object_type type, | |||
219 | } | 226 | } |
220 | } | 227 | } |
221 | 228 | ||
222 | status = user_function(child_node, level, | 229 | status = |
223 | context, return_value); | 230 | user_function(child_node, level, context, |
231 | return_value); | ||
224 | 232 | ||
225 | if (flags & ACPI_NS_WALK_UNLOCK) { | 233 | if (flags & ACPI_NS_WALK_UNLOCK) { |
226 | mutex_status = | 234 | mutex_status = |
@@ -254,20 +262,17 @@ acpi_ns_walk_namespace(acpi_object_type type, | |||
254 | } | 262 | } |
255 | 263 | ||
256 | /* | 264 | /* |
257 | * Depth first search: | 265 | * Depth first search: Attempt to go down another level in the |
258 | * Attempt to go down another level in the namespace | 266 | * namespace if we are allowed to. Don't go any further if we have |
259 | * if we are allowed to. Don't go any further if we | 267 | * reached the caller specified maximum depth or if the user |
260 | * have reached the caller specified maximum depth | 268 | * function has specified that the maximum depth has been reached. |
261 | * or if the user function has specified that the | ||
262 | * maximum depth has been reached. | ||
263 | */ | 269 | */ |
264 | if ((level < max_depth) && (status != AE_CTRL_DEPTH)) { | 270 | if ((level < max_depth) && (status != AE_CTRL_DEPTH)) { |
265 | if (acpi_ns_get_next_node | 271 | if (acpi_ns_get_next_node |
266 | (ACPI_TYPE_ANY, child_node, NULL)) { | 272 | (ACPI_TYPE_ANY, child_node, NULL)) { |
267 | /* | 273 | |
268 | * There is at least one child of this | 274 | /* There is at least one child of this node, visit it */ |
269 | * node, visit the onde | 275 | |
270 | */ | ||
271 | level++; | 276 | level++; |
272 | parent_node = child_node; | 277 | parent_node = child_node; |
273 | child_node = NULL; | 278 | child_node = NULL; |
@@ -275,9 +280,8 @@ acpi_ns_walk_namespace(acpi_object_type type, | |||
275 | } | 280 | } |
276 | } else { | 281 | } else { |
277 | /* | 282 | /* |
278 | * No more children of this node (acpi_ns_get_next_node | 283 | * No more children of this node (acpi_ns_get_next_node failed), go |
279 | * failed), go back upwards in the namespace tree to | 284 | * back upwards in the namespace tree to the node's parent. |
280 | * the node's parent. | ||
281 | */ | 285 | */ |
282 | level--; | 286 | level--; |
283 | child_node = parent_node; | 287 | child_node = parent_node; |