]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/utilities/utdelete.c
Merge branch 'pnp-fix' into release-2.6.27
[linux-2.6-omap-h63xx.git] / drivers / acpi / utilities / utdelete.c
index f777cebdc46dd85f8ec66b491096f9d2f20af1a3..42609d3a8aa9db23f3852743f767ee1641b631af 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2007, R. Byron Moore
+ * Copyright (C) 2000 - 2008, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -135,6 +135,10 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
                obj_pointer = object->package.elements;
                break;
 
+               /*
+                * These objects have a possible list of notify handlers.
+                * Device object also may have a GPE block.
+                */
        case ACPI_TYPE_DEVICE:
 
                if (object->device.gpe_block) {
@@ -142,9 +146,14 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
                                                       gpe_block);
                }
 
-               /* Walk the handler list for this device */
+               /*lint -fallthrough */
+
+       case ACPI_TYPE_PROCESSOR:
+       case ACPI_TYPE_THERMAL:
+
+               /* Walk the notify handler list for this object */
 
-               handler_desc = object->device.handler;
+               handler_desc = object->common_notify.handler;
                while (handler_desc) {
                        next_desc = handler_desc->address_space.next;
                        acpi_ut_remove_reference(handler_desc);
@@ -158,7 +167,7 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
                                  "***** Mutex %p, OS Mutex %p\n",
                                  object, object->mutex.os_mutex));
 
-               if (object->mutex.os_mutex == acpi_gbl_global_lock_mutex) {
+               if (object == acpi_gbl_global_lock_mutex) {
 
                        /* Global Lock has extra semaphore */
 
@@ -252,6 +261,17 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
                }
                break;
 
+       case ACPI_TYPE_LOCAL_BANK_FIELD:
+
+               ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
+                                 "***** Bank Field %p\n", object));
+
+               second_desc = acpi_ns_get_secondary_object(object);
+               if (second_desc) {
+                       acpi_ut_delete_object_desc(second_desc);
+               }
+               break;
+
        default:
                break;
        }
@@ -431,7 +451,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
        union acpi_generic_state *state_list = NULL;
        union acpi_operand_object *next_object = NULL;
        union acpi_generic_state *state;
-       acpi_native_uint i;
+       u32 i;
 
        ACPI_FUNCTION_TRACE_PTR(ut_update_object_reference, object);
 
@@ -524,10 +544,12 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
 
                case ACPI_TYPE_LOCAL_REFERENCE:
                        /*
-                        * The target of an Index (a package, string, or buffer) must track
-                        * changes to the ref count of the index.
+                        * The target of an Index (a package, string, or buffer) or a named
+                        * reference must track changes to the ref count of the index or
+                        * target object.
                         */
-                       if (object->reference.opcode == AML_INDEX_OP) {
+                       if ((object->reference.opcode == AML_INDEX_OP) ||
+                           (object->reference.opcode == AML_INT_NAMEPATH_OP)) {
                                next_object = object->reference.object;
                        }
                        break;