aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/nsxfeval.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/acpica/nsxfeval.c')
-rw-r--r--drivers/acpi/acpica/nsxfeval.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/drivers/acpi/acpica/nsxfeval.c b/drivers/acpi/acpica/nsxfeval.c
index 4929dbdbc8f0..f2bd1da77001 100644
--- a/drivers/acpi/acpica/nsxfeval.c
+++ b/drivers/acpi/acpica/nsxfeval.c
@@ -433,8 +433,11 @@ static void acpi_ns_resolve_references(struct acpi_evaluate_info *info)
433 * PARAMETERS: Type - acpi_object_type to search for 433 * PARAMETERS: Type - acpi_object_type to search for
434 * start_object - Handle in namespace where search begins 434 * start_object - Handle in namespace where search begins
435 * max_depth - Depth to which search is to reach 435 * max_depth - Depth to which search is to reach
436 * user_function - Called when an object of "Type" is found 436 * pre_order_visit - Called during tree pre-order visit
437 * Context - Passed to user function 437 * when an object of "Type" is found
438 * post_order_visit - Called during tree post-order visit
439 * when an object of "Type" is found
440 * Context - Passed to user function(s) above
438 * return_value - Location where return value of 441 * return_value - Location where return value of
439 * user_function is put if terminated early 442 * user_function is put if terminated early
440 * 443 *
@@ -443,16 +446,16 @@ static void acpi_ns_resolve_references(struct acpi_evaluate_info *info)
443 * 446 *
444 * DESCRIPTION: Performs a modified depth-first walk of the namespace tree, 447 * DESCRIPTION: Performs a modified depth-first walk of the namespace tree,
445 * starting (and ending) at the object specified by start_handle. 448 * starting (and ending) at the object specified by start_handle.
446 * The user_function is called whenever an object that matches 449 * The callback function is called whenever an object that matches
447 * the type parameter is found. If the user function returns 450 * the type parameter is found. If the callback function returns
448 * a non-zero value, the search is terminated immediately and this 451 * a non-zero value, the search is terminated immediately and this
449 * value is returned to the caller. 452 * value is returned to the caller.
450 * 453 *
451 * The point of this procedure is to provide a generic namespace 454 * The point of this procedure is to provide a generic namespace
452 * walk routine that can be called from multiple places to 455 * walk routine that can be called from multiple places to
453 * provide multiple services; the User Function can be tailored 456 * provide multiple services; the callback function(s) can be
454 * to each task, whether it is a print function, a compare 457 * tailored to each task, whether it is a print function,
455 * function, etc. 458 * a compare function, etc.
456 * 459 *
457 ******************************************************************************/ 460 ******************************************************************************/
458 461
@@ -460,7 +463,8 @@ acpi_status
460acpi_walk_namespace(acpi_object_type type, 463acpi_walk_namespace(acpi_object_type type,
461 acpi_handle start_object, 464 acpi_handle start_object,
462 u32 max_depth, 465 u32 max_depth,
463 acpi_walk_callback user_function, 466 acpi_walk_callback pre_order_visit,
467 acpi_walk_callback post_order_visit,
464 void *context, void **return_value) 468 void *context, void **return_value)
465{ 469{
466 acpi_status status; 470 acpi_status status;
@@ -469,7 +473,8 @@ acpi_walk_namespace(acpi_object_type type,
469 473
470 /* Parameter validation */ 474 /* Parameter validation */
471 475
472 if ((type > ACPI_TYPE_LOCAL_MAX) || (!max_depth) || (!user_function)) { 476 if ((type > ACPI_TYPE_LOCAL_MAX) ||
477 (!max_depth) || (!pre_order_visit && !post_order_visit)) {
473 return_ACPI_STATUS(AE_BAD_PARAMETER); 478 return_ACPI_STATUS(AE_BAD_PARAMETER);
474 } 479 }
475 480
@@ -501,8 +506,9 @@ acpi_walk_namespace(acpi_object_type type,
501 } 506 }
502 507
503 status = acpi_ns_walk_namespace(type, start_object, max_depth, 508 status = acpi_ns_walk_namespace(type, start_object, max_depth,
504 ACPI_NS_WALK_UNLOCK, user_function, 509 ACPI_NS_WALK_UNLOCK, pre_order_visit,
505 context, return_value); 510 post_order_visit, context,
511 return_value);
506 512
507 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 513 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
508 514
@@ -681,8 +687,8 @@ acpi_get_devices(const char *HID,
681 687
682 status = acpi_ns_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, 688 status = acpi_ns_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
683 ACPI_UINT32_MAX, ACPI_NS_WALK_UNLOCK, 689 ACPI_UINT32_MAX, ACPI_NS_WALK_UNLOCK,
684 acpi_ns_get_device_callback, &info, 690 acpi_ns_get_device_callback, NULL,
685 return_value); 691 &info, return_value);
686 692
687 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 693 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
688 return_ACPI_STATUS(status); 694 return_ACPI_STATUS(status);