diff options
Diffstat (limited to 'drivers/acpi/events/evregion.c')
-rw-r--r-- | drivers/acpi/events/evregion.c | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/drivers/acpi/events/evregion.c b/drivers/acpi/events/evregion.c index 094a17e4c86d..21caae04fe85 100644 --- a/drivers/acpi/events/evregion.c +++ b/drivers/acpi/events/evregion.c | |||
@@ -528,34 +528,40 @@ acpi_ev_detach_region(union acpi_operand_object *region_obj, | |||
528 | } | 528 | } |
529 | } | 529 | } |
530 | 530 | ||
531 | /* Call the setup handler with the deactivate notification */ | 531 | /* |
532 | * If the region has been activated, call the setup handler | ||
533 | * with the deactivate notification | ||
534 | */ | ||
535 | if (region_obj->region.flags & AOPOBJ_SETUP_COMPLETE) { | ||
536 | region_setup = handler_obj->address_space.setup; | ||
537 | status = | ||
538 | region_setup(region_obj, | ||
539 | ACPI_REGION_DEACTIVATE, | ||
540 | handler_obj->address_space. | ||
541 | context, region_context); | ||
532 | 542 | ||
533 | region_setup = handler_obj->address_space.setup; | 543 | /* Init routine may fail, Just ignore errors */ |
534 | status = | ||
535 | region_setup(region_obj, ACPI_REGION_DEACTIVATE, | ||
536 | handler_obj->address_space.context, | ||
537 | region_context); | ||
538 | 544 | ||
539 | /* Init routine may fail, Just ignore errors */ | 545 | if (ACPI_FAILURE(status)) { |
546 | ACPI_EXCEPTION((AE_INFO, status, | ||
547 | "from region handler - deactivate, [%s]", | ||
548 | acpi_ut_get_region_name | ||
549 | (region_obj->region. | ||
550 | space_id))); | ||
551 | } | ||
540 | 552 | ||
541 | if (ACPI_FAILURE(status)) { | 553 | region_obj->region.flags &= |
542 | ACPI_EXCEPTION((AE_INFO, status, | 554 | ~(AOPOBJ_SETUP_COMPLETE); |
543 | "from region init, [%s]", | ||
544 | acpi_ut_get_region_name | ||
545 | (region_obj->region.space_id))); | ||
546 | } | 555 | } |
547 | 556 | ||
548 | region_obj->region.flags &= ~(AOPOBJ_SETUP_COMPLETE); | ||
549 | |||
550 | /* | 557 | /* |
551 | * Remove handler reference in the region | 558 | * Remove handler reference in the region |
552 | * | 559 | * |
553 | * NOTE: this doesn't mean that the region goes away | 560 | * NOTE: this doesn't mean that the region goes away, the region |
554 | * The region is just inaccessible as indicated to | 561 | * is just inaccessible as indicated to the _REG method |
555 | * the _REG method | ||
556 | * | 562 | * |
557 | * If the region is on the handler's list | 563 | * If the region is on the handler's list, this must be the |
558 | * this better be the region's handler | 564 | * region's handler |
559 | */ | 565 | */ |
560 | region_obj->region.handler = NULL; | 566 | region_obj->region.handler = NULL; |
561 | acpi_ut_remove_reference(handler_obj); | 567 | acpi_ut_remove_reference(handler_obj); |