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.c54
1 files changed, 25 insertions, 29 deletions
diff --git a/drivers/acpi/acpica/nsaccess.c b/drivers/acpi/acpica/nsaccess.c
index 88303ebe924..9c3cdbe2d82 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;
@@ -234,8 +232,7 @@ acpi_status acpi_ns_root_initialize(void)
234 /* Store pointer to value descriptor in the Node */ 232 /* Store pointer to value descriptor in the Node */
235 233
236 status = acpi_ns_attach_object(new_node, obj_desc, 234 status = acpi_ns_attach_object(new_node, obj_desc,
237 ACPI_GET_OBJECT_TYPE 235 obj_desc->common.type);
238 (obj_desc));
239 236
240 /* Remove local reference to the object */ 237 /* Remove local reference to the object */
241 238
@@ -315,10 +312,8 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
315 return_ACPI_STATUS(AE_NO_NAMESPACE); 312 return_ACPI_STATUS(AE_NO_NAMESPACE);
316 } 313 }
317 314
318 /* 315 /* Get the prefix scope. A null scope means use the root scope */
319 * Get the prefix scope. 316
320 * A null scope means use the root scope
321 */
322 if ((!scope_info) || (!scope_info->scope.node)) { 317 if ((!scope_info) || (!scope_info->scope.node)) {
323 ACPI_DEBUG_PRINT((ACPI_DB_NAMES, 318 ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
324 "Null scope prefix, using root node (%p)\n", 319 "Null scope prefix, using root node (%p)\n",
@@ -338,8 +333,8 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
338 if (!(flags & ACPI_NS_PREFIX_IS_SCOPE)) { 333 if (!(flags & ACPI_NS_PREFIX_IS_SCOPE)) {
339 /* 334 /*
340 * 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
341 * Device/Method, etc.) It could be a Package or other object node. 336 * Device/Method, etc.) It could be a Package or other object
342 * Backup up the tree to find the containing scope node. 337 * node. Backup up the tree to find the containing scope node.
343 */ 338 */
344 while (!acpi_ns_opens_scope(prefix_node->type) && 339 while (!acpi_ns_opens_scope(prefix_node->type) &&
345 prefix_node->type != ACPI_TYPE_ANY) { 340 prefix_node->type != ACPI_TYPE_ANY) {
@@ -349,7 +344,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
349 } 344 }
350 } 345 }
351 346
352 /* Save type TBD: may be no longer necessary */ 347 /* Save type. TBD: may be no longer necessary */
353 348
354 type_to_check_for = type; 349 type_to_check_for = type;
355 350
@@ -414,6 +409,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
414 /* Name is fully qualified, no search rules apply */ 409 /* Name is fully qualified, no search rules apply */
415 410
416 search_parent_flag = ACPI_NS_NO_UPSEARCH; 411 search_parent_flag = ACPI_NS_NO_UPSEARCH;
412
417 /* 413 /*
418 * Point past this prefix to the name segment 414 * Point past this prefix to the name segment
419 * part or the next Parent Prefix 415 * part or the next Parent Prefix
@@ -429,7 +425,8 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
429 /* Current scope has no parent scope */ 425 /* Current scope has no parent scope */
430 426
431 ACPI_ERROR((AE_INFO, 427 ACPI_ERROR((AE_INFO,
432 "ACPI path has too many parent prefixes (^) - reached beyond root node")); 428 "ACPI path has too many parent prefixes (^) "
429 "- reached beyond root node"));
433 return_ACPI_STATUS(AE_NOT_FOUND); 430 return_ACPI_STATUS(AE_NOT_FOUND);
434 } 431 }
435 } 432 }
@@ -531,9 +528,9 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
531 while (num_segments && current_node) { 528 while (num_segments && current_node) {
532 num_segments--; 529 num_segments--;
533 if (!num_segments) { 530 if (!num_segments) {
534 /* 531
535 * This is the last segment, enable typechecking 532 /* This is the last segment, enable typechecking */
536 */ 533
537 this_search_type = type; 534 this_search_type = type;
538 535
539 /* 536 /*
@@ -584,9 +581,9 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
584 if (num_segments > 0) { 581 if (num_segments > 0) {
585 /* 582 /*
586 * 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
587 * device or processor), we need to dereference the alias here so that 584 * device or processor), we need to dereference the alias here so
588 * 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
589 * segments). 586 * remaining segments).
590 */ 587 */
591 if (this_node->type == ACPI_TYPE_LOCAL_ALIAS) { 588 if (this_node->type == ACPI_TYPE_LOCAL_ALIAS) {
592 if (!this_node->object) { 589 if (!this_node->object) {
@@ -594,8 +591,8 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
594 } 591 }
595 592
596 if (acpi_ns_opens_scope 593 if (acpi_ns_opens_scope
597 (((struct acpi_namespace_node *)this_node-> 594 (((struct acpi_namespace_node *)
598 object)->type)) { 595 this_node->object)->type)) {
599 this_node = 596 this_node =
600 (struct acpi_namespace_node *) 597 (struct acpi_namespace_node *)
601 this_node->object; 598 this_node->object;
@@ -639,8 +636,8 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
639 636
640 /* 637 /*
641 * 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
642 * 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
643 * to (later) see if it opens a scope. 640 * type to (later) see if it opens a scope.
644 */ 641 */
645 if (type == ACPI_TYPE_ANY) { 642 if (type == ACPI_TYPE_ANY) {
646 type = this_node->type; 643 type = this_node->type;
@@ -653,9 +650,8 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
653 current_node = this_node; 650 current_node = this_node;
654 } 651 }
655 652
656 /* 653 /* Always check if we need to open a new scope */
657 * Always check if we need to open a new scope 654
658 */
659 if (!(flags & ACPI_NS_DONT_OPEN_SCOPE) && (walk_state)) { 655 if (!(flags & ACPI_NS_DONT_OPEN_SCOPE) && (walk_state)) {
660 /* 656 /*
661 * 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