diff options
Diffstat (limited to 'drivers/acpi/parser/psparse.c')
-rw-r--r-- | drivers/acpi/parser/psparse.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/acpi/parser/psparse.c b/drivers/acpi/parser/psparse.c index 3248051d77ee..36771309c62f 100644 --- a/drivers/acpi/parser/psparse.c +++ b/drivers/acpi/parser/psparse.c | |||
@@ -438,7 +438,6 @@ acpi_ps_next_parse_state(struct acpi_walk_state *walk_state, | |||
438 | acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) | 438 | acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) |
439 | { | 439 | { |
440 | acpi_status status; | 440 | acpi_status status; |
441 | acpi_status terminate_status; | ||
442 | struct acpi_thread_state *thread; | 441 | struct acpi_thread_state *thread; |
443 | struct acpi_thread_state *prev_walk_list = acpi_gbl_current_walk_list; | 442 | struct acpi_thread_state *prev_walk_list = acpi_gbl_current_walk_list; |
444 | struct acpi_walk_state *previous_walk_state; | 443 | struct acpi_walk_state *previous_walk_state; |
@@ -508,6 +507,9 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) | |||
508 | walk_state->method_node, NULL, | 507 | walk_state->method_node, NULL, |
509 | status); | 508 | status); |
510 | 509 | ||
510 | /* Make sure that failed method will be cleaned as if it was executed */ | ||
511 | walk_state->parse_flags |= ACPI_PARSE_EXECUTE; | ||
512 | |||
511 | /* Check for possible multi-thread reentrancy problem */ | 513 | /* Check for possible multi-thread reentrancy problem */ |
512 | 514 | ||
513 | if ((status == AE_ALREADY_EXISTS) && | 515 | if ((status == AE_ALREADY_EXISTS) && |
@@ -524,14 +526,6 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) | |||
524 | } | 526 | } |
525 | } | 527 | } |
526 | 528 | ||
527 | if (walk_state->method_desc) { | ||
528 | /* Decrement the thread count on the method parse tree */ | ||
529 | |||
530 | if (walk_state->method_desc->method.thread_count) { | ||
531 | walk_state->method_desc->method.thread_count--; | ||
532 | } | ||
533 | } | ||
534 | |||
535 | /* We are done with this walk, move on to the parent if any */ | 529 | /* We are done with this walk, move on to the parent if any */ |
536 | 530 | ||
537 | walk_state = acpi_ds_pop_walk_state(thread); | 531 | walk_state = acpi_ds_pop_walk_state(thread); |
@@ -546,13 +540,10 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) | |||
546 | */ | 540 | */ |
547 | if ((walk_state->parse_flags & ACPI_PARSE_MODE_MASK) == | 541 | if ((walk_state->parse_flags & ACPI_PARSE_MODE_MASK) == |
548 | ACPI_PARSE_EXECUTE) { | 542 | ACPI_PARSE_EXECUTE) { |
549 | terminate_status = | 543 | if (walk_state->method_desc) { |
550 | acpi_ds_terminate_control_method(walk_state); | 544 | walk_state->method_desc->method.thread_count--; |
551 | if (ACPI_FAILURE(terminate_status)) { | ||
552 | ACPI_REPORT_ERROR(("Could not terminate control method properly\n")); | ||
553 | |||
554 | /* Ignore error and continue */ | ||
555 | } | 545 | } |
546 | acpi_ds_terminate_control_method (walk_state); | ||
556 | } | 547 | } |
557 | 548 | ||
558 | /* Delete this walk state and all linked control states */ | 549 | /* Delete this walk state and all linked control states */ |