diff options
Diffstat (limited to 'drivers/acpi/namespace')
-rw-r--r-- | drivers/acpi/namespace/nsaccess.c | 7 | ||||
-rw-r--r-- | drivers/acpi/namespace/nsalloc.c | 8 | ||||
-rw-r--r-- | drivers/acpi/namespace/nsdump.c | 4 | ||||
-rw-r--r-- | drivers/acpi/namespace/nseval.c | 1 | ||||
-rw-r--r-- | drivers/acpi/namespace/nsinit.c | 5 | ||||
-rw-r--r-- | drivers/acpi/namespace/nsload.c | 3 | ||||
-rw-r--r-- | drivers/acpi/namespace/nsobject.c | 3 | ||||
-rw-r--r-- | drivers/acpi/namespace/nssearch.c | 3 | ||||
-rw-r--r-- | drivers/acpi/namespace/nsutils.c | 6 | ||||
-rw-r--r-- | drivers/acpi/namespace/nswalk.c | 4 | ||||
-rw-r--r-- | drivers/acpi/namespace/nsxfeval.c | 46 | ||||
-rw-r--r-- | drivers/acpi/namespace/nsxfname.c | 1 | ||||
-rw-r--r-- | drivers/acpi/namespace/nsxfobj.c | 1 |
13 files changed, 71 insertions, 21 deletions
diff --git a/drivers/acpi/namespace/nsaccess.c b/drivers/acpi/namespace/nsaccess.c index 1149bc18fb35..6bdad8bfcf0b 100644 --- a/drivers/acpi/namespace/nsaccess.c +++ b/drivers/acpi/namespace/nsaccess.c | |||
@@ -98,6 +98,7 @@ acpi_status acpi_ns_root_initialize(void) | |||
98 | "Entering predefined entries into namespace\n")); | 98 | "Entering predefined entries into namespace\n")); |
99 | 99 | ||
100 | for (init_val = acpi_gbl_pre_defined_names; init_val->name; init_val++) { | 100 | for (init_val = acpi_gbl_pre_defined_names; init_val->name; init_val++) { |
101 | |||
101 | /* _OSI is optional for now, will be permanent later */ | 102 | /* _OSI is optional for now, will be permanent later */ |
102 | 103 | ||
103 | if (!ACPI_STRCMP(init_val->name, "_OSI") | 104 | if (!ACPI_STRCMP(init_val->name, "_OSI") |
@@ -365,6 +366,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info, | |||
365 | * Begin examination of the actual pathname | 366 | * Begin examination of the actual pathname |
366 | */ | 367 | */ |
367 | if (!pathname) { | 368 | if (!pathname) { |
369 | |||
368 | /* A Null name_path is allowed and refers to the root */ | 370 | /* A Null name_path is allowed and refers to the root */ |
369 | 371 | ||
370 | num_segments = 0; | 372 | num_segments = 0; |
@@ -389,6 +391,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info, | |||
389 | * to the current scope). | 391 | * to the current scope). |
390 | */ | 392 | */ |
391 | if (*path == (u8) AML_ROOT_PREFIX) { | 393 | if (*path == (u8) AML_ROOT_PREFIX) { |
394 | |||
392 | /* Pathname is fully qualified, start from the root */ | 395 | /* Pathname is fully qualified, start from the root */ |
393 | 396 | ||
394 | this_node = acpi_gbl_root_node; | 397 | this_node = acpi_gbl_root_node; |
@@ -416,6 +419,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info, | |||
416 | this_node = prefix_node; | 419 | this_node = prefix_node; |
417 | num_carats = 0; | 420 | num_carats = 0; |
418 | while (*path == (u8) AML_PARENT_PREFIX) { | 421 | while (*path == (u8) AML_PARENT_PREFIX) { |
422 | |||
419 | /* Name is fully qualified, no search rules apply */ | 423 | /* Name is fully qualified, no search rules apply */ |
420 | 424 | ||
421 | search_parent_flag = ACPI_NS_NO_UPSEARCH; | 425 | search_parent_flag = ACPI_NS_NO_UPSEARCH; |
@@ -430,6 +434,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info, | |||
430 | num_carats++; | 434 | num_carats++; |
431 | this_node = acpi_ns_get_parent_node(this_node); | 435 | this_node = acpi_ns_get_parent_node(this_node); |
432 | if (!this_node) { | 436 | if (!this_node) { |
437 | |||
433 | /* Current scope has no parent scope */ | 438 | /* Current scope has no parent scope */ |
434 | 439 | ||
435 | ACPI_ERROR((AE_INFO, | 440 | ACPI_ERROR((AE_INFO, |
@@ -569,6 +574,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info, | |||
569 | &this_node); | 574 | &this_node); |
570 | if (ACPI_FAILURE(status)) { | 575 | if (ACPI_FAILURE(status)) { |
571 | if (status == AE_NOT_FOUND) { | 576 | if (status == AE_NOT_FOUND) { |
577 | |||
572 | /* Name not found in ACPI namespace */ | 578 | /* Name not found in ACPI namespace */ |
573 | 579 | ||
574 | ACPI_DEBUG_PRINT((ACPI_DB_NAMES, | 580 | ACPI_DEBUG_PRINT((ACPI_DB_NAMES, |
@@ -602,6 +608,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info, | |||
602 | (type_to_check_for != ACPI_TYPE_LOCAL_SCOPE) && | 608 | (type_to_check_for != ACPI_TYPE_LOCAL_SCOPE) && |
603 | (this_node->type != ACPI_TYPE_ANY) && | 609 | (this_node->type != ACPI_TYPE_ANY) && |
604 | (this_node->type != type_to_check_for)) { | 610 | (this_node->type != type_to_check_for)) { |
611 | |||
605 | /* Complain about a type mismatch */ | 612 | /* Complain about a type mismatch */ |
606 | 613 | ||
607 | ACPI_WARNING((AE_INFO, | 614 | ACPI_WARNING((AE_INFO, |
diff --git a/drivers/acpi/namespace/nsalloc.c b/drivers/acpi/namespace/nsalloc.c index 9b871f38b61b..cd26cb971a1c 100644 --- a/drivers/acpi/namespace/nsalloc.c +++ b/drivers/acpi/namespace/nsalloc.c | |||
@@ -115,6 +115,7 @@ void acpi_ns_delete_node(struct acpi_namespace_node *node) | |||
115 | } | 115 | } |
116 | 116 | ||
117 | if (prev_node) { | 117 | if (prev_node) { |
118 | |||
118 | /* Node is not first child, unlink it */ | 119 | /* Node is not first child, unlink it */ |
119 | 120 | ||
120 | prev_node->peer = next_node->peer; | 121 | prev_node->peer = next_node->peer; |
@@ -125,6 +126,7 @@ void acpi_ns_delete_node(struct acpi_namespace_node *node) | |||
125 | /* Node is first child (has no previous peer) */ | 126 | /* Node is first child (has no previous peer) */ |
126 | 127 | ||
127 | if (next_node->flags & ANOBJ_END_OF_PEER_LIST) { | 128 | if (next_node->flags & ANOBJ_END_OF_PEER_LIST) { |
129 | |||
128 | /* No peers at all */ | 130 | /* No peers at all */ |
129 | 131 | ||
130 | parent_node->child = NULL; | 132 | parent_node->child = NULL; |
@@ -264,6 +266,7 @@ void acpi_ns_delete_children(struct acpi_namespace_node *parent_node) | |||
264 | * Deallocate all children at this level | 266 | * Deallocate all children at this level |
265 | */ | 267 | */ |
266 | do { | 268 | do { |
269 | |||
267 | /* Get the things we need */ | 270 | /* Get the things we need */ |
268 | 271 | ||
269 | next_node = child_node->peer; | 272 | next_node = child_node->peer; |
@@ -352,11 +355,13 @@ void acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_node) | |||
352 | * to where we started. | 355 | * to where we started. |
353 | */ | 356 | */ |
354 | while (level > 0) { | 357 | while (level > 0) { |
358 | |||
355 | /* Get the next node in this scope (NULL if none) */ | 359 | /* Get the next node in this scope (NULL if none) */ |
356 | 360 | ||
357 | child_node = acpi_ns_get_next_node(ACPI_TYPE_ANY, parent_node, | 361 | child_node = acpi_ns_get_next_node(ACPI_TYPE_ANY, parent_node, |
358 | child_node); | 362 | child_node); |
359 | if (child_node) { | 363 | if (child_node) { |
364 | |||
360 | /* Found a child node - detach any attached object */ | 365 | /* Found a child node - detach any attached object */ |
361 | 366 | ||
362 | acpi_ns_detach_object(child_node); | 367 | acpi_ns_detach_object(child_node); |
@@ -427,6 +432,7 @@ static void acpi_ns_remove_reference(struct acpi_namespace_node *node) | |||
427 | */ | 432 | */ |
428 | this_node = node; | 433 | this_node = node; |
429 | while (this_node) { | 434 | while (this_node) { |
435 | |||
430 | /* Prepare to move up to parent */ | 436 | /* Prepare to move up to parent */ |
431 | 437 | ||
432 | parent_node = acpi_ns_get_parent_node(this_node); | 438 | parent_node = acpi_ns_get_parent_node(this_node); |
@@ -438,6 +444,7 @@ static void acpi_ns_remove_reference(struct acpi_namespace_node *node) | |||
438 | /* Delete the node if no more references */ | 444 | /* Delete the node if no more references */ |
439 | 445 | ||
440 | if (!this_node->reference_count) { | 446 | if (!this_node->reference_count) { |
447 | |||
441 | /* Delete all children and delete the node */ | 448 | /* Delete all children and delete the node */ |
442 | 449 | ||
443 | acpi_ns_delete_children(this_node); | 450 | acpi_ns_delete_children(this_node); |
@@ -500,6 +507,7 @@ void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id) | |||
500 | 507 | ||
501 | if (child_node) { | 508 | if (child_node) { |
502 | if (child_node->owner_id == owner_id) { | 509 | if (child_node->owner_id == owner_id) { |
510 | |||
503 | /* Found a matching child node - detach any attached object */ | 511 | /* Found a matching child node - detach any attached object */ |
504 | 512 | ||
505 | acpi_ns_detach_object(child_node); | 513 | acpi_ns_detach_object(child_node); |
diff --git a/drivers/acpi/namespace/nsdump.c b/drivers/acpi/namespace/nsdump.c index a2807317a84b..e275373b1705 100644 --- a/drivers/acpi/namespace/nsdump.c +++ b/drivers/acpi/namespace/nsdump.c | |||
@@ -191,6 +191,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle, | |||
191 | } | 191 | } |
192 | 192 | ||
193 | if (!(info->display_type & ACPI_DISPLAY_SHORT)) { | 193 | if (!(info->display_type & ACPI_DISPLAY_SHORT)) { |
194 | |||
194 | /* Indent the object according to the level */ | 195 | /* Indent the object according to the level */ |
195 | 196 | ||
196 | acpi_os_printf("%2d%*s", (u32) level - 1, (int)level * 2, " "); | 197 | acpi_os_printf("%2d%*s", (u32) level - 1, (int)level * 2, " "); |
@@ -226,6 +227,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle, | |||
226 | case ACPI_DISPLAY_SUMMARY: | 227 | case ACPI_DISPLAY_SUMMARY: |
227 | 228 | ||
228 | if (!obj_desc) { | 229 | if (!obj_desc) { |
230 | |||
229 | /* No attached object, we are done */ | 231 | /* No attached object, we are done */ |
230 | 232 | ||
231 | acpi_os_printf("\n"); | 233 | acpi_os_printf("\n"); |
@@ -419,6 +421,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle, | |||
419 | 421 | ||
420 | acpi_os_printf("O:%p", obj_desc); | 422 | acpi_os_printf("O:%p", obj_desc); |
421 | if (!obj_desc) { | 423 | if (!obj_desc) { |
424 | |||
422 | /* No attached object, we are done */ | 425 | /* No attached object, we are done */ |
423 | 426 | ||
424 | acpi_os_printf("\n"); | 427 | acpi_os_printf("\n"); |
@@ -682,6 +685,7 @@ void acpi_ns_dump_tables(acpi_handle search_base, u32 max_depth) | |||
682 | } | 685 | } |
683 | 686 | ||
684 | if (ACPI_NS_ALL == search_base) { | 687 | if (ACPI_NS_ALL == search_base) { |
688 | |||
685 | /* Entire namespace */ | 689 | /* Entire namespace */ |
686 | 690 | ||
687 | search_handle = acpi_gbl_root_node; | 691 | search_handle = acpi_gbl_root_node; |
diff --git a/drivers/acpi/namespace/nseval.c b/drivers/acpi/namespace/nseval.c index 19d7b94d40c3..80ef95545636 100644 --- a/drivers/acpi/namespace/nseval.c +++ b/drivers/acpi/namespace/nseval.c | |||
@@ -326,6 +326,7 @@ acpi_status acpi_ns_evaluate_by_handle(struct acpi_parameter_info *info) | |||
326 | * Check if there is a return value on the stack that must be dealt with | 326 | * Check if there is a return value on the stack that must be dealt with |
327 | */ | 327 | */ |
328 | if (status == AE_CTRL_RETURN_VALUE) { | 328 | if (status == AE_CTRL_RETURN_VALUE) { |
329 | |||
329 | /* Map AE_CTRL_RETURN_VALUE to AE_OK, we are done with it */ | 330 | /* Map AE_CTRL_RETURN_VALUE to AE_OK, we are done with it */ |
330 | 331 | ||
331 | status = AE_OK; | 332 | status = AE_OK; |
diff --git a/drivers/acpi/namespace/nsinit.c b/drivers/acpi/namespace/nsinit.c index 9f929e479fd8..9aa337c33887 100644 --- a/drivers/acpi/namespace/nsinit.c +++ b/drivers/acpi/namespace/nsinit.c | |||
@@ -366,6 +366,7 @@ acpi_ns_init_one_device(acpi_handle obj_handle, | |||
366 | status = acpi_ns_search_node(*ACPI_CAST_PTR(u32, METHOD_NAME__INI), | 366 | status = acpi_ns_search_node(*ACPI_CAST_PTR(u32, METHOD_NAME__INI), |
367 | device_node, ACPI_TYPE_METHOD, &ini_node); | 367 | device_node, ACPI_TYPE_METHOD, &ini_node); |
368 | if (ACPI_FAILURE(status)) { | 368 | if (ACPI_FAILURE(status)) { |
369 | |||
369 | /* No _INI method found - move on to next device */ | 370 | /* No _INI method found - move on to next device */ |
370 | 371 | ||
371 | return_ACPI_STATUS(AE_OK); | 372 | return_ACPI_STATUS(AE_OK); |
@@ -386,6 +387,7 @@ acpi_ns_init_one_device(acpi_handle obj_handle, | |||
386 | 387 | ||
387 | status = acpi_ut_execute_STA(pinfo.node, &flags); | 388 | status = acpi_ut_execute_STA(pinfo.node, &flags); |
388 | if (ACPI_FAILURE(status)) { | 389 | if (ACPI_FAILURE(status)) { |
390 | |||
389 | /* Ignore error and move on to next device */ | 391 | /* Ignore error and move on to next device */ |
390 | 392 | ||
391 | return_ACPI_STATUS(AE_OK); | 393 | return_ACPI_STATUS(AE_OK); |
@@ -396,6 +398,7 @@ acpi_ns_init_one_device(acpi_handle obj_handle, | |||
396 | } | 398 | } |
397 | 399 | ||
398 | if (!(flags & ACPI_STA_DEVICE_PRESENT)) { | 400 | if (!(flags & ACPI_STA_DEVICE_PRESENT)) { |
401 | |||
399 | /* Don't look at children of a not present device */ | 402 | /* Don't look at children of a not present device */ |
400 | 403 | ||
401 | return_ACPI_STATUS(AE_CTRL_DEPTH); | 404 | return_ACPI_STATUS(AE_CTRL_DEPTH); |
@@ -412,6 +415,7 @@ acpi_ns_init_one_device(acpi_handle obj_handle, | |||
412 | pinfo.node = ini_node; | 415 | pinfo.node = ini_node; |
413 | status = acpi_ns_evaluate_by_handle(&pinfo); | 416 | status = acpi_ns_evaluate_by_handle(&pinfo); |
414 | if (ACPI_FAILURE(status)) { | 417 | if (ACPI_FAILURE(status)) { |
418 | |||
415 | /* Ignore error and move on to next device */ | 419 | /* Ignore error and move on to next device */ |
416 | 420 | ||
417 | #ifdef ACPI_DEBUG_OUTPUT | 421 | #ifdef ACPI_DEBUG_OUTPUT |
@@ -435,6 +439,7 @@ acpi_ns_init_one_device(acpi_handle obj_handle, | |||
435 | } | 439 | } |
436 | 440 | ||
437 | if (acpi_gbl_init_handler) { | 441 | if (acpi_gbl_init_handler) { |
442 | |||
438 | /* External initialization handler is present, call it */ | 443 | /* External initialization handler is present, call it */ |
439 | 444 | ||
440 | status = | 445 | status = |
diff --git a/drivers/acpi/namespace/nsload.c b/drivers/acpi/namespace/nsload.c index 4e0b0524c188..80acfd35f3ec 100644 --- a/drivers/acpi/namespace/nsload.c +++ b/drivers/acpi/namespace/nsload.c | |||
@@ -84,6 +84,7 @@ acpi_ns_load_table(struct acpi_table_desc *table_desc, | |||
84 | if (! | 84 | if (! |
85 | (acpi_gbl_table_data[table_desc->type]. | 85 | (acpi_gbl_table_data[table_desc->type]. |
86 | flags & ACPI_TABLE_EXECUTABLE)) { | 86 | flags & ACPI_TABLE_EXECUTABLE)) { |
87 | |||
87 | /* Just ignore this table */ | 88 | /* Just ignore this table */ |
88 | 89 | ||
89 | return_ACPI_STATUS(AE_OK); | 90 | return_ACPI_STATUS(AE_OK); |
@@ -325,6 +326,7 @@ static acpi_status acpi_ns_delete_subtree(acpi_handle start_handle) | |||
325 | * to where we started. | 326 | * to where we started. |
326 | */ | 327 | */ |
327 | while (level > 0) { | 328 | while (level > 0) { |
329 | |||
328 | /* Attempt to get the next object in this scope */ | 330 | /* Attempt to get the next object in this scope */ |
329 | 331 | ||
330 | status = acpi_get_next_object(ACPI_TYPE_ANY, parent_handle, | 332 | status = acpi_get_next_object(ACPI_TYPE_ANY, parent_handle, |
@@ -335,6 +337,7 @@ static acpi_status acpi_ns_delete_subtree(acpi_handle start_handle) | |||
335 | /* Did we get a new object? */ | 337 | /* Did we get a new object? */ |
336 | 338 | ||
337 | if (ACPI_SUCCESS(status)) { | 339 | if (ACPI_SUCCESS(status)) { |
340 | |||
338 | /* Check if this object has any children */ | 341 | /* Check if this object has any children */ |
339 | 342 | ||
340 | if (ACPI_SUCCESS | 343 | if (ACPI_SUCCESS |
diff --git a/drivers/acpi/namespace/nsobject.c b/drivers/acpi/namespace/nsobject.c index 10ae6292bca4..39dc87b228fc 100644 --- a/drivers/acpi/namespace/nsobject.c +++ b/drivers/acpi/namespace/nsobject.c | |||
@@ -82,6 +82,7 @@ acpi_ns_attach_object(struct acpi_namespace_node *node, | |||
82 | * Parameter validation | 82 | * Parameter validation |
83 | */ | 83 | */ |
84 | if (!node) { | 84 | if (!node) { |
85 | |||
85 | /* Invalid handle */ | 86 | /* Invalid handle */ |
86 | 87 | ||
87 | ACPI_ERROR((AE_INFO, "Null named_obj handle")); | 88 | ACPI_ERROR((AE_INFO, "Null named_obj handle")); |
@@ -89,6 +90,7 @@ acpi_ns_attach_object(struct acpi_namespace_node *node, | |||
89 | } | 90 | } |
90 | 91 | ||
91 | if (!object && (ACPI_TYPE_ANY != type)) { | 92 | if (!object && (ACPI_TYPE_ANY != type)) { |
93 | |||
92 | /* Null object */ | 94 | /* Null object */ |
93 | 95 | ||
94 | ACPI_ERROR((AE_INFO, | 96 | ACPI_ERROR((AE_INFO, |
@@ -97,6 +99,7 @@ acpi_ns_attach_object(struct acpi_namespace_node *node, | |||
97 | } | 99 | } |
98 | 100 | ||
99 | if (ACPI_GET_DESCRIPTOR_TYPE(node) != ACPI_DESC_TYPE_NAMED) { | 101 | if (ACPI_GET_DESCRIPTOR_TYPE(node) != ACPI_DESC_TYPE_NAMED) { |
102 | |||
100 | /* Not a name handle */ | 103 | /* Not a name handle */ |
101 | 104 | ||
102 | ACPI_ERROR((AE_INFO, "Invalid handle %p [%s]", | 105 | ACPI_ERROR((AE_INFO, "Invalid handle %p [%s]", |
diff --git a/drivers/acpi/namespace/nssearch.c b/drivers/acpi/namespace/nssearch.c index d64b78952f24..f73a3d566168 100644 --- a/drivers/acpi/namespace/nssearch.c +++ b/drivers/acpi/namespace/nssearch.c | |||
@@ -114,9 +114,11 @@ acpi_ns_search_node(u32 target_name, | |||
114 | */ | 114 | */ |
115 | next_node = node->child; | 115 | next_node = node->child; |
116 | while (next_node) { | 116 | while (next_node) { |
117 | |||
117 | /* Check for match against the name */ | 118 | /* Check for match against the name */ |
118 | 119 | ||
119 | if (next_node->name.integer == target_name) { | 120 | if (next_node->name.integer == target_name) { |
121 | |||
120 | /* Resolve a control method alias if any */ | 122 | /* Resolve a control method alias if any */ |
121 | 123 | ||
122 | if (acpi_ns_get_type(next_node) == | 124 | if (acpi_ns_get_type(next_node) == |
@@ -146,6 +148,7 @@ acpi_ns_search_node(u32 target_name, | |||
146 | * so a flag is used to indicate the end-of-list | 148 | * so a flag is used to indicate the end-of-list |
147 | */ | 149 | */ |
148 | if (next_node->flags & ANOBJ_END_OF_PEER_LIST) { | 150 | if (next_node->flags & ANOBJ_END_OF_PEER_LIST) { |
151 | |||
149 | /* Searched entire list, we are done */ | 152 | /* Searched entire list, we are done */ |
150 | 153 | ||
151 | break; | 154 | break; |
diff --git a/drivers/acpi/namespace/nsutils.c b/drivers/acpi/namespace/nsutils.c index 3e7cad549a38..e8c779114bec 100644 --- a/drivers/acpi/namespace/nsutils.c +++ b/drivers/acpi/namespace/nsutils.c | |||
@@ -83,6 +83,7 @@ acpi_ns_report_error(char *module_name, | |||
83 | acpi_ut_report_error(module_name, line_number); | 83 | acpi_ut_report_error(module_name, line_number); |
84 | 84 | ||
85 | if (lookup_status == AE_BAD_CHARACTER) { | 85 | if (lookup_status == AE_BAD_CHARACTER) { |
86 | |||
86 | /* There is a non-ascii character in the name */ | 87 | /* There is a non-ascii character in the name */ |
87 | 88 | ||
88 | acpi_os_printf("[0x%4.4X] (NON-ASCII)", | 89 | acpi_os_printf("[0x%4.4X] (NON-ASCII)", |
@@ -267,6 +268,7 @@ u32 acpi_ns_local(acpi_object_type type) | |||
267 | ACPI_FUNCTION_TRACE("ns_local"); | 268 | ACPI_FUNCTION_TRACE("ns_local"); |
268 | 269 | ||
269 | if (!acpi_ut_valid_object_type(type)) { | 270 | if (!acpi_ut_valid_object_type(type)) { |
271 | |||
270 | /* Type code out of range */ | 272 | /* Type code out of range */ |
271 | 273 | ||
272 | ACPI_WARNING((AE_INFO, "Invalid Object Type %X", type)); | 274 | ACPI_WARNING((AE_INFO, "Invalid Object Type %X", type)); |
@@ -411,6 +413,7 @@ acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info) | |||
411 | for (i = 0; i < ACPI_NAME_SIZE; i++) { | 413 | for (i = 0; i < ACPI_NAME_SIZE; i++) { |
412 | if (acpi_ns_valid_path_separator(*external_name) || | 414 | if (acpi_ns_valid_path_separator(*external_name) || |
413 | (*external_name == 0)) { | 415 | (*external_name == 0)) { |
416 | |||
414 | /* Pad the segment with underscore(s) if segment is short */ | 417 | /* Pad the segment with underscore(s) if segment is short */ |
415 | 418 | ||
416 | result[i] = '_'; | 419 | result[i] = '_'; |
@@ -795,6 +798,7 @@ u32 acpi_ns_opens_scope(acpi_object_type type) | |||
795 | ACPI_FUNCTION_TRACE_STR("ns_opens_scope", acpi_ut_get_type_name(type)); | 798 | ACPI_FUNCTION_TRACE_STR("ns_opens_scope", acpi_ut_get_type_name(type)); |
796 | 799 | ||
797 | if (!acpi_ut_valid_object_type(type)) { | 800 | if (!acpi_ut_valid_object_type(type)) { |
801 | |||
798 | /* type code out of range */ | 802 | /* type code out of range */ |
799 | 803 | ||
800 | ACPI_WARNING((AE_INFO, "Invalid Object Type %X", type)); | 804 | ACPI_WARNING((AE_INFO, "Invalid Object Type %X", type)); |
@@ -838,6 +842,7 @@ acpi_ns_get_node_by_path(char *pathname, | |||
838 | ACPI_FUNCTION_TRACE_PTR("ns_get_node_by_path", pathname); | 842 | ACPI_FUNCTION_TRACE_PTR("ns_get_node_by_path", pathname); |
839 | 843 | ||
840 | if (pathname) { | 844 | if (pathname) { |
845 | |||
841 | /* Convert path to internal representation */ | 846 | /* Convert path to internal representation */ |
842 | 847 | ||
843 | status = acpi_ns_internalize_name(pathname, &internal_path); | 848 | status = acpi_ns_internalize_name(pathname, &internal_path); |
@@ -963,6 +968,7 @@ acpi_name acpi_ns_find_parent_name(struct acpi_namespace_node * child_node) | |||
963 | ACPI_FUNCTION_TRACE("ns_find_parent_name"); | 968 | ACPI_FUNCTION_TRACE("ns_find_parent_name"); |
964 | 969 | ||
965 | if (child_node) { | 970 | if (child_node) { |
971 | |||
966 | /* Valid entry. Get the parent Node */ | 972 | /* Valid entry. Get the parent Node */ |
967 | 973 | ||
968 | parent_node = acpi_ns_get_parent_node(child_node); | 974 | parent_node = acpi_ns_get_parent_node(child_node); |
diff --git a/drivers/acpi/namespace/nswalk.c b/drivers/acpi/namespace/nswalk.c index fcab1e784b81..6bbc734bfee2 100644 --- a/drivers/acpi/namespace/nswalk.c +++ b/drivers/acpi/namespace/nswalk.c | |||
@@ -76,6 +76,7 @@ struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type, | |||
76 | ACPI_FUNCTION_ENTRY(); | 76 | ACPI_FUNCTION_ENTRY(); |
77 | 77 | ||
78 | if (!child_node) { | 78 | if (!child_node) { |
79 | |||
79 | /* It's really the parent's _scope_ that we want */ | 80 | /* It's really the parent's _scope_ that we want */ |
80 | 81 | ||
81 | if (parent_node->child) { | 82 | if (parent_node->child) { |
@@ -92,6 +93,7 @@ struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type, | |||
92 | /* If any type is OK, we are done */ | 93 | /* If any type is OK, we are done */ |
93 | 94 | ||
94 | if (type == ACPI_TYPE_ANY) { | 95 | if (type == ACPI_TYPE_ANY) { |
96 | |||
95 | /* next_node is NULL if we are at the end-of-list */ | 97 | /* next_node is NULL if we are at the end-of-list */ |
96 | 98 | ||
97 | return (next_node); | 99 | return (next_node); |
@@ -100,6 +102,7 @@ struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type, | |||
100 | /* Must search for the node -- but within this scope only */ | 102 | /* Must search for the node -- but within this scope only */ |
101 | 103 | ||
102 | while (next_node) { | 104 | while (next_node) { |
105 | |||
103 | /* If type matches, we are done */ | 106 | /* If type matches, we are done */ |
104 | 107 | ||
105 | if (next_node->type == type) { | 108 | if (next_node->type == type) { |
@@ -182,6 +185,7 @@ acpi_ns_walk_namespace(acpi_object_type type, | |||
182 | * bubbled up to (and passed) the original parent handle (start_entry) | 185 | * bubbled up to (and passed) the original parent handle (start_entry) |
183 | */ | 186 | */ |
184 | while (level > 0) { | 187 | while (level > 0) { |
188 | |||
185 | /* Get the next node in this scope. Null if not found */ | 189 | /* Get the next node in this scope. Null if not found */ |
186 | 190 | ||
187 | status = AE_OK; | 191 | status = AE_OK; |
diff --git a/drivers/acpi/namespace/nsxfeval.c b/drivers/acpi/namespace/nsxfeval.c index a95f636dc35d..71e7769d7daf 100644 --- a/drivers/acpi/namespace/nsxfeval.c +++ b/drivers/acpi/namespace/nsxfeval.c | |||
@@ -110,6 +110,7 @@ acpi_evaluate_object_typed(acpi_handle handle, | |||
110 | } | 110 | } |
111 | 111 | ||
112 | if (return_buffer->length == 0) { | 112 | if (return_buffer->length == 0) { |
113 | |||
113 | /* Error because caller specifically asked for a return value */ | 114 | /* Error because caller specifically asked for a return value */ |
114 | 115 | ||
115 | ACPI_ERROR((AE_INFO, "No return value")); | 116 | ACPI_ERROR((AE_INFO, "No return value")); |
@@ -131,6 +132,7 @@ acpi_evaluate_object_typed(acpi_handle handle, | |||
131 | acpi_ut_get_type_name(return_type))); | 132 | acpi_ut_get_type_name(return_type))); |
132 | 133 | ||
133 | if (must_free) { | 134 | if (must_free) { |
135 | |||
134 | /* Caller used ACPI_ALLOCATE_BUFFER, free the return buffer */ | 136 | /* Caller used ACPI_ALLOCATE_BUFFER, free the return buffer */ |
135 | 137 | ||
136 | acpi_os_free(return_buffer->pointer); | 138 | acpi_os_free(return_buffer->pointer); |
@@ -224,9 +226,9 @@ acpi_evaluate_object(acpi_handle handle, | |||
224 | * 3) Valid handle | 226 | * 3) Valid handle |
225 | */ | 227 | */ |
226 | if ((pathname) && (acpi_ns_valid_root_prefix(pathname[0]))) { | 228 | if ((pathname) && (acpi_ns_valid_root_prefix(pathname[0]))) { |
227 | /* | 229 | |
228 | * The path is fully qualified, just evaluate by name | 230 | /* The path is fully qualified, just evaluate by name */ |
229 | */ | 231 | |
230 | status = acpi_ns_evaluate_by_name(pathname, &info); | 232 | status = acpi_ns_evaluate_by_name(pathname, &info); |
231 | } else if (!handle) { | 233 | } else if (!handle) { |
232 | /* | 234 | /* |
@@ -235,11 +237,12 @@ acpi_evaluate_object(acpi_handle handle, | |||
235 | * qualified names above, this is an error | 237 | * qualified names above, this is an error |
236 | */ | 238 | */ |
237 | if (!pathname) { | 239 | if (!pathname) { |
238 | ACPI_ERROR((AE_INFO, | 240 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
239 | "Both Handle and Pathname are NULL")); | 241 | "Both Handle and Pathname are NULL")); |
240 | } else { | 242 | } else { |
241 | ACPI_ERROR((AE_INFO, | 243 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
242 | "Handle is NULL and Pathname is relative")); | 244 | "Null Handle with relative pathname [%s]", |
245 | pathname)); | ||
243 | } | 246 | } |
244 | 247 | ||
245 | status = AE_BAD_PARAMETER; | 248 | status = AE_BAD_PARAMETER; |
@@ -256,9 +259,8 @@ acpi_evaluate_object(acpi_handle handle, | |||
256 | */ | 259 | */ |
257 | status = acpi_ns_evaluate_by_handle(&info); | 260 | status = acpi_ns_evaluate_by_handle(&info); |
258 | } else { | 261 | } else { |
259 | /* | 262 | /* Both a Handle and a relative Pathname */ |
260 | * Both a Handle and a relative Pathname | 263 | |
261 | */ | ||
262 | status = acpi_ns_evaluate_relative(pathname, &info); | 264 | status = acpi_ns_evaluate_relative(pathname, &info); |
263 | } | 265 | } |
264 | } | 266 | } |
@@ -295,6 +297,7 @@ acpi_evaluate_object(acpi_handle handle, | |||
295 | acpi_ut_get_object_size(info.return_object, | 297 | acpi_ut_get_object_size(info.return_object, |
296 | &buffer_space_needed); | 298 | &buffer_space_needed); |
297 | if (ACPI_SUCCESS(status)) { | 299 | if (ACPI_SUCCESS(status)) { |
300 | |||
298 | /* Validate/Allocate/Clear caller buffer */ | 301 | /* Validate/Allocate/Clear caller buffer */ |
299 | 302 | ||
300 | status = | 303 | status = |
@@ -303,7 +306,8 @@ acpi_evaluate_object(acpi_handle handle, | |||
303 | buffer_space_needed); | 306 | buffer_space_needed); |
304 | if (ACPI_FAILURE(status)) { | 307 | if (ACPI_FAILURE(status)) { |
305 | /* | 308 | /* |
306 | * Caller's buffer is too small or a new one can't be allocated | 309 | * Caller's buffer is too small or a new one can't |
310 | * be allocated | ||
307 | */ | 311 | */ |
308 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 312 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
309 | "Needed buffer size %X, %s\n", | 313 | "Needed buffer size %X, %s\n", |
@@ -312,9 +316,8 @@ acpi_evaluate_object(acpi_handle handle, | |||
312 | acpi_format_exception | 316 | acpi_format_exception |
313 | (status))); | 317 | (status))); |
314 | } else { | 318 | } else { |
315 | /* | 319 | /* We have enough space for the object, build it */ |
316 | * We have enough space for the object, build it | 320 | |
317 | */ | ||
318 | status = | 321 | status = |
319 | acpi_ut_copy_iobject_to_eobject | 322 | acpi_ut_copy_iobject_to_eobject |
320 | (info.return_object, | 323 | (info.return_object, |
@@ -341,10 +344,10 @@ acpi_evaluate_object(acpi_handle handle, | |||
341 | } | 344 | } |
342 | } | 345 | } |
343 | 346 | ||
344 | /* | 347 | /* Free the input parameter list (if we created one) */ |
345 | * Free the input parameter list (if we created one), | 348 | |
346 | */ | ||
347 | if (info.parameters) { | 349 | if (info.parameters) { |
350 | |||
348 | /* Free the allocated parameter block */ | 351 | /* Free the allocated parameter block */ |
349 | 352 | ||
350 | acpi_ut_delete_internal_object_list(info.parameters); | 353 | acpi_ut_delete_internal_object_list(info.parameters); |
@@ -473,6 +476,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle, | |||
473 | } | 476 | } |
474 | 477 | ||
475 | if (!(flags & ACPI_STA_DEVICE_PRESENT)) { | 478 | if (!(flags & ACPI_STA_DEVICE_PRESENT)) { |
479 | |||
476 | /* Don't examine children of the device if not present */ | 480 | /* Don't examine children of the device if not present */ |
477 | 481 | ||
478 | return (AE_CTRL_DEPTH); | 482 | return (AE_CTRL_DEPTH); |
@@ -489,6 +493,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle, | |||
489 | } | 493 | } |
490 | 494 | ||
491 | if (ACPI_STRNCMP(hid.value, info->hid, sizeof(hid.value)) != 0) { | 495 | if (ACPI_STRNCMP(hid.value, info->hid, sizeof(hid.value)) != 0) { |
496 | |||
492 | /* Get the list of Compatible IDs */ | 497 | /* Get the list of Compatible IDs */ |
493 | 498 | ||
494 | status = acpi_ut_execute_CID(node, &cid); | 499 | status = acpi_ut_execute_CID(node, &cid); |
@@ -563,9 +568,9 @@ acpi_get_devices(char *HID, | |||
563 | * We're going to call their callback from OUR callback, so we need | 568 | * We're going to call their callback from OUR callback, so we need |
564 | * to know what it is, and their context parameter. | 569 | * to know what it is, and their context parameter. |
565 | */ | 570 | */ |
571 | info.hid = HID; | ||
566 | info.context = context; | 572 | info.context = context; |
567 | info.user_function = user_function; | 573 | info.user_function = user_function; |
568 | info.hid = HID; | ||
569 | 574 | ||
570 | /* | 575 | /* |
571 | * Lock the namespace around the walk. | 576 | * Lock the namespace around the walk. |
@@ -578,9 +583,8 @@ acpi_get_devices(char *HID, | |||
578 | return_ACPI_STATUS(status); | 583 | return_ACPI_STATUS(status); |
579 | } | 584 | } |
580 | 585 | ||
581 | status = acpi_ns_walk_namespace(ACPI_TYPE_DEVICE, | 586 | status = acpi_ns_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, |
582 | ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, | 587 | ACPI_UINT32_MAX, ACPI_NS_WALK_UNLOCK, |
583 | ACPI_NS_WALK_UNLOCK, | ||
584 | acpi_ns_get_device_callback, &info, | 588 | acpi_ns_get_device_callback, &info, |
585 | return_value); | 589 | return_value); |
586 | 590 | ||
diff --git a/drivers/acpi/namespace/nsxfname.c b/drivers/acpi/namespace/nsxfname.c index 8cd8675a47c0..55d26624ab9f 100644 --- a/drivers/acpi/namespace/nsxfname.c +++ b/drivers/acpi/namespace/nsxfname.c | |||
@@ -162,6 +162,7 @@ acpi_get_name(acpi_handle handle, u32 name_type, struct acpi_buffer * buffer) | |||
162 | } | 162 | } |
163 | 163 | ||
164 | if (name_type == ACPI_FULL_PATHNAME) { | 164 | if (name_type == ACPI_FULL_PATHNAME) { |
165 | |||
165 | /* Get the full pathname (From the namespace root) */ | 166 | /* Get the full pathname (From the namespace root) */ |
166 | 167 | ||
167 | status = acpi_ns_handle_to_pathname(handle, buffer); | 168 | status = acpi_ns_handle_to_pathname(handle, buffer); |
diff --git a/drivers/acpi/namespace/nsxfobj.c b/drivers/acpi/namespace/nsxfobj.c index a0332595677a..9c5f3302799c 100644 --- a/drivers/acpi/namespace/nsxfobj.c +++ b/drivers/acpi/namespace/nsxfobj.c | |||
@@ -206,6 +206,7 @@ acpi_get_next_object(acpi_object_type type, | |||
206 | /* If null handle, use the parent */ | 206 | /* If null handle, use the parent */ |
207 | 207 | ||
208 | if (!child) { | 208 | if (!child) { |
209 | |||
209 | /* Start search at the beginning of the specified scope */ | 210 | /* Start search at the beginning of the specified scope */ |
210 | 211 | ||
211 | parent_node = acpi_ns_map_handle_to_node(parent); | 212 | parent_node = acpi_ns_map_handle_to_node(parent); |