]> 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 c1c6c236df9affedc4ba07f0bbd161684b4053a6..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,31 +195,27 @@ acpi_status acpi_ns_root_initialize(void)
                                obj_desc->mutex.sync_level =
                                    (u8) (ACPI_TO_INTEGER(val) - 1);
 
-                               if (ACPI_STRCMP(init_val->name, "_GL_") == 0) {
+                               /* Create a mutex */
 
-                                       /* Create a counting semaphore for the global lock */
+                               status =
+                                   acpi_os_create_mutex(&obj_desc->mutex.
+                                                        os_mutex);
+                               if (ACPI_FAILURE(status)) {
+                                       acpi_ut_remove_reference(obj_desc);
+                                       goto unlock_and_exit;
+                               }
 
-                                       status =
-                                           acpi_os_create_semaphore
-                                           (ACPI_NO_UNIT_LIMIT, 1,
-                                            &acpi_gbl_global_lock_semaphore);
-                                       if (ACPI_FAILURE(status)) {
-                                               acpi_ut_remove_reference
-                                                   (obj_desc);
-                                               goto unlock_and_exit;
-                                       }
+                               /* Special case for ACPI Global Lock */
 
-                                       /* Mark this mutex as very special */
+                               if (ACPI_STRCMP(init_val->name, "_GL_") == 0) {
+                                       acpi_gbl_global_lock_mutex =
+                                           obj_desc->mutex.os_mutex;
 
-                                       obj_desc->mutex.os_mutex =
-                                           ACPI_GLOBAL_LOCK;
-                               } else {
-                                       /* Create a mutex */
+                                       /* Create additional counting semaphore for global lock */
 
                                        status =
-                                           acpi_os_create_mutex(&obj_desc->
-                                                                mutex.
-                                                                os_mutex);
+                                           acpi_os_create_semaphore(1, 0,
+                                                                    &acpi_gbl_global_lock_semaphore);
                                        if (ACPI_FAILURE(status)) {
                                                acpi_ut_remove_reference
                                                    (obj_desc);