Merge branch 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
[pandora-kernel.git] / drivers / acpi / utilities / utdelete.c
index 38ebe1c..673a0ca 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2006, R. Byron Moore
+ * Copyright (C) 2000 - 2007, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -158,16 +158,19 @@ 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_GLOBAL_LOCK) {
-                       acpi_ex_unlink_mutex(object);
-                       acpi_os_delete_mutex(object->mutex.os_mutex);
-               } else {
-                       /* Global Lock "mutex" is actually a counting semaphore */
+               if (object->mutex.os_mutex == acpi_gbl_global_lock_mutex) {
+
+                       /* Global Lock has extra semaphore */
 
                        (void)
                            acpi_os_delete_semaphore
                            (acpi_gbl_global_lock_semaphore);
                        acpi_gbl_global_lock_semaphore = NULL;
+
+                       acpi_os_delete_mutex(object->mutex.os_mutex);
+                       acpi_gbl_global_lock_mutex = NULL;
+               } else {
+                       acpi_os_delete_mutex(object->mutex.os_mutex);
                }
                break;
 
@@ -447,11 +450,16 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
                 */
                switch (ACPI_GET_OBJECT_TYPE(object)) {
                case ACPI_TYPE_DEVICE:
+               case ACPI_TYPE_PROCESSOR:
+               case ACPI_TYPE_POWER:
+               case ACPI_TYPE_THERMAL:
+
+                       /* Update the notify objects for these types (if present) */
 
-                       acpi_ut_update_ref_count(object->device.system_notify,
-                                                action);
-                       acpi_ut_update_ref_count(object->device.device_notify,
-                                                action);
+                       acpi_ut_update_ref_count(object->common_notify.
+                                                system_notify, action);
+                       acpi_ut_update_ref_count(object->common_notify.
+                                                device_notify, action);
                        break;
 
                case ACPI_TYPE_PACKAGE: