aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/nsaccess.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/acpica/nsaccess.c')
-rw-r--r--drivers/acpi/acpica/nsaccess.c51
1 files changed, 24 insertions, 27 deletions
diff --git a/drivers/acpi/acpica/nsaccess.c b/drivers/acpi/acpica/nsaccess.c
index b6968a65cd4f..9c3cdbe2d82a 100644
--- a/drivers/acpi/acpica/nsaccess.c
+++ b/drivers/acpi/acpica/nsaccess.c
@@ -118,9 +118,8 @@ acpi_status acpi_ns_root_initialize(void)
118 } 118 }
119 119
120 /* 120 /*
121 * Name entered successfully. 121 * Name entered successfully. If entry in pre_defined_names[] specifies
122 * If entry in pre_defined_names[] specifies an 122 * an initial value, create the initial value.
123 * initial value, create the initial value.
124 */ 123 */
125 if (init_val->val) { 124 if (init_val->val) {
126 status = acpi_os_predefined_override(init_val, &val); 125 status = acpi_os_predefined_override(init_val, &val);
@@ -178,9 +177,8 @@ acpi_status acpi_ns_root_initialize(void)
178 177
179 case ACPI_TYPE_STRING: 178 case ACPI_TYPE_STRING:
180 179
181 /* 180 /* Build an object around the static string */
182 * Build an object around the static string 181
183 */
184 obj_desc->string.length = 182 obj_desc->string.length =
185 (u32) ACPI_STRLEN(val); 183 (u32) ACPI_STRLEN(val);
186 obj_desc->string.pointer = val; 184 obj_desc->string.pointer = val;
@@ -314,10 +312,8 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
314 return_ACPI_STATUS(AE_NO_NAMESPACE); 312 return_ACPI_STATUS(AE_NO_NAMESPACE);
315 } 313 }
316 314
317 /* 315 /* Get the prefix scope. A null scope means use the root scope */
318 * Get the prefix scope. 316
319 * A null scope means use the root scope
320 */
321 if ((!scope_info) || (!scope_info->scope.node)) { 317 if ((!scope_info) || (!scope_info->scope.node)) {
322 ACPI_DEBUG_PRINT((ACPI_DB_NAMES, 318 ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
323 "Null scope prefix, using root node (%p)\n", 319 "Null scope prefix, using root node (%p)\n",
@@ -337,8 +333,8 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
337 if (!(flags & ACPI_NS_PREFIX_IS_SCOPE)) { 333 if (!(flags & ACPI_NS_PREFIX_IS_SCOPE)) {
338 /* 334 /*
339 * This node might not be a actual "scope" node (such as a 335 * This node might not be a actual "scope" node (such as a
340 * Device/Method, etc.) It could be a Package or other object node. 336 * Device/Method, etc.) It could be a Package or other object
341 * Backup up the tree to find the containing scope node. 337 * node. Backup up the tree to find the containing scope node.
342 */ 338 */
343 while (!acpi_ns_opens_scope(prefix_node->type) && 339 while (!acpi_ns_opens_scope(prefix_node->type) &&
344 prefix_node->type != ACPI_TYPE_ANY) { 340 prefix_node->type != ACPI_TYPE_ANY) {
@@ -348,7 +344,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
348 } 344 }
349 } 345 }
350 346
351 /* Save type TBD: may be no longer necessary */ 347 /* Save type. TBD: may be no longer necessary */
352 348
353 type_to_check_for = type; 349 type_to_check_for = type;
354 350
@@ -413,6 +409,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
413 /* Name is fully qualified, no search rules apply */ 409 /* Name is fully qualified, no search rules apply */
414 410
415 search_parent_flag = ACPI_NS_NO_UPSEARCH; 411 search_parent_flag = ACPI_NS_NO_UPSEARCH;
412
416 /* 413 /*
417 * Point past this prefix to the name segment 414 * Point past this prefix to the name segment
418 * part or the next Parent Prefix 415 * part or the next Parent Prefix
@@ -428,7 +425,8 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
428 /* Current scope has no parent scope */ 425 /* Current scope has no parent scope */
429 426
430 ACPI_ERROR((AE_INFO, 427 ACPI_ERROR((AE_INFO,
431 "ACPI path has too many parent prefixes (^) - reached beyond root node")); 428 "ACPI path has too many parent prefixes (^) "
429 "- reached beyond root node"));
432 return_ACPI_STATUS(AE_NOT_FOUND); 430 return_ACPI_STATUS(AE_NOT_FOUND);
433 } 431 }
434 } 432 }
@@ -530,9 +528,9 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
530 while (num_segments && current_node) { 528 while (num_segments && current_node) {
531 num_segments--; 529 num_segments--;
532 if (!num_segments) { 530 if (!num_segments) {
533 /* 531
534 * This is the last segment, enable typechecking 532 /* This is the last segment, enable typechecking */
535 */ 533
536 this_search_type = type; 534 this_search_type = type;
537 535
538 /* 536 /*
@@ -583,9 +581,9 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
583 if (num_segments > 0) { 581 if (num_segments > 0) {
584 /* 582 /*
585 * If we have an alias to an object that opens a scope (such as a 583 * If we have an alias to an object that opens a scope (such as a
586 * device or processor), we need to dereference the alias here so that 584 * device or processor), we need to dereference the alias here so
587 * we can access any children of the original node (via the remaining 585 * that we can access any children of the original node (via the
588 * segments). 586 * remaining segments).
589 */ 587 */
590 if (this_node->type == ACPI_TYPE_LOCAL_ALIAS) { 588 if (this_node->type == ACPI_TYPE_LOCAL_ALIAS) {
591 if (!this_node->object) { 589 if (!this_node->object) {
@@ -593,8 +591,8 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
593 } 591 }
594 592
595 if (acpi_ns_opens_scope 593 if (acpi_ns_opens_scope
596 (((struct acpi_namespace_node *)this_node-> 594 (((struct acpi_namespace_node *)
597 object)->type)) { 595 this_node->object)->type)) {
598 this_node = 596 this_node =
599 (struct acpi_namespace_node *) 597 (struct acpi_namespace_node *)
600 this_node->object; 598 this_node->object;
@@ -638,8 +636,8 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
638 636
639 /* 637 /*
640 * If this is the last name segment and we are not looking for a 638 * If this is the last name segment and we are not looking for a
641 * specific type, but the type of found object is known, use that type 639 * specific type, but the type of found object is known, use that
642 * to (later) see if it opens a scope. 640 * type to (later) see if it opens a scope.
643 */ 641 */
644 if (type == ACPI_TYPE_ANY) { 642 if (type == ACPI_TYPE_ANY) {
645 type = this_node->type; 643 type = this_node->type;
@@ -652,9 +650,8 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
652 current_node = this_node; 650 current_node = this_node;
653 } 651 }
654 652
655 /* 653 /* Always check if we need to open a new scope */
656 * Always check if we need to open a new scope 654
657 */
658 if (!(flags & ACPI_NS_DONT_OPEN_SCOPE) && (walk_state)) { 655 if (!(flags & ACPI_NS_DONT_OPEN_SCOPE) && (walk_state)) {
659 /* 656 /*
660 * If entry is a type which opens a scope, push the new scope on the 657 * If entry is a type which opens a scope, push the new scope on the