]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/namespace/nsaccess.c
Merge branches 'release' and 'dsdt-override' into release
[linux-2.6-omap-h63xx.git] / drivers / acpi / namespace / nsaccess.c
index 48fadade52e2b17bbd55777fd30204bb2168548d..57faf598bad8f2fe98055f34589f23a2c341d976 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
@@ -195,34 +195,27 @@ acpi_status acpi_ns_root_initialize(void)
                                obj_desc->mutex.sync_level =
                                    (u8) (ACPI_TO_INTEGER(val) - 1);
 
+                               /* Create a mutex */
+
+                               status =
+                                   acpi_os_create_mutex(&obj_desc->mutex.
+                                                        os_mutex);
+                               if (ACPI_FAILURE(status)) {
+                                       acpi_ut_remove_reference(obj_desc);
+                                       goto unlock_and_exit;
+                               }
+
+                               /* Special case for ACPI Global Lock */
+
                                if (ACPI_STRCMP(init_val->name, "_GL_") == 0) {
-                                       /*
-                                        * Create a counting semaphore for the
-                                        * global lock
-                                        */
-                                       status =
-                                           acpi_os_create_semaphore
-                                           (ACPI_NO_UNIT_LIMIT, 1,
-                                            &obj_desc->mutex.semaphore);
-                                       if (ACPI_FAILURE(status)) {
-                                               acpi_ut_remove_reference
-                                                   (obj_desc);
-                                               goto unlock_and_exit;
-                                       }
+                                       acpi_gbl_global_lock_mutex =
+                                           obj_desc->mutex.os_mutex;
+
+                                       /* Create additional counting semaphore for global lock */
 
-                                       /*
-                                        * We just created the mutex for the
-                                        * global lock, save it
-                                        */
-                                       acpi_gbl_global_lock_semaphore =
-                                           obj_desc->mutex.semaphore;
-                               } else {
-                                       /* Create a mutex */
-
-                                       status = acpi_os_create_semaphore(1, 1,
-                                                                         &obj_desc->
-                                                                         mutex.
-                                                                         semaphore);
+                                       status =
+                                           acpi_os_create_semaphore(1, 0,
+                                                                    &acpi_gbl_global_lock_semaphore);
                                        if (ACPI_FAILURE(status)) {
                                                acpi_ut_remove_reference
                                                    (obj_desc);