aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/utdelete.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2012-05-03 11:08:19 +0800
committerLen Brown <len.brown@intel.com>2012-06-01 11:51:50 -0400
commit86ed4bc83abf530cf2019044b74f89a39dfd6425 (patch)
tree7cd21414f6121486079be2ca9cb9ff0a7722e01b /drivers/acpi/acpica/utdelete.c
parentACPICA: Lint fixes for acpi_write, no functional changes (diff)
downloadlinux-dev-86ed4bc83abf530cf2019044b74f89a39dfd6425.tar.xz
linux-dev-86ed4bc83abf530cf2019044b74f89a39dfd6425.zip
ACPICA: Add support for multiple notify handlers
This change adds support to allow multiple notify handlers on Device, ThermalZone, and Processor objects. Also re-worked and restructured the entire notify support code for handler installation, handler removal, notify event queuing, and notify dispatch to handler. Extends and updates original commit 3f0be67("ACPI / ACPICA: Multiple system notify handlers per device") by Rafael Wysocki. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/utdelete.c')
-rw-r--r--drivers/acpi/acpica/utdelete.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/acpi/acpica/utdelete.c b/drivers/acpi/acpica/utdelete.c
index 2a6c3e183697..0d50f2c6bac2 100644
--- a/drivers/acpi/acpica/utdelete.c
+++ b/drivers/acpi/acpica/utdelete.c
@@ -152,7 +152,7 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
case ACPI_TYPE_PROCESSOR:
case ACPI_TYPE_THERMAL:
- /* Walk the notify handler list for this object */
+ /* Walk the address handler list for this object */
handler_desc = object->common_notify.handler;
while (handler_desc) {
@@ -480,6 +480,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
acpi_status status = AE_OK;
union acpi_generic_state *state_list = NULL;
union acpi_operand_object *next_object = NULL;
+ union acpi_operand_object *prev_object;
union acpi_generic_state *state;
u32 i;
@@ -505,12 +506,21 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
case ACPI_TYPE_POWER:
case ACPI_TYPE_THERMAL:
- /* Update the notify objects for these types (if present) */
-
- acpi_ut_update_ref_count(object->common_notify.
- system_notify, action);
- acpi_ut_update_ref_count(object->common_notify.
- device_notify, action);
+ /*
+ * Update the notify objects for these types (if present)
+ * Two lists, system and device notify handlers.
+ */
+ for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) {
+ prev_object =
+ object->common_notify.notify_list[i];
+ while (prev_object) {
+ next_object =
+ prev_object->notify.next[i];
+ acpi_ut_update_ref_count(prev_object,
+ action);
+ prev_object = next_object;
+ }
+ }
break;
case ACPI_TYPE_PACKAGE: