diff options
Diffstat (limited to 'drivers/acpi/namespace/nsaccess.c')
-rw-r--r-- | drivers/acpi/namespace/nsaccess.c | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/drivers/acpi/namespace/nsaccess.c b/drivers/acpi/namespace/nsaccess.c index c1c6c236df9..b2ef6730be8 100644 --- a/drivers/acpi/namespace/nsaccess.c +++ b/drivers/acpi/namespace/nsaccess.c | |||
@@ -195,31 +195,27 @@ acpi_status acpi_ns_root_initialize(void) | |||
195 | obj_desc->mutex.sync_level = | 195 | obj_desc->mutex.sync_level = |
196 | (u8) (ACPI_TO_INTEGER(val) - 1); | 196 | (u8) (ACPI_TO_INTEGER(val) - 1); |
197 | 197 | ||
198 | if (ACPI_STRCMP(init_val->name, "_GL_") == 0) { | 198 | /* Create a mutex */ |
199 | 199 | ||
200 | /* Create a counting semaphore for the global lock */ | 200 | status = |
201 | acpi_os_create_mutex(&obj_desc->mutex. | ||
202 | os_mutex); | ||
203 | if (ACPI_FAILURE(status)) { | ||
204 | acpi_ut_remove_reference(obj_desc); | ||
205 | goto unlock_and_exit; | ||
206 | } | ||
201 | 207 | ||
202 | status = | 208 | /* Special case for ACPI Global Lock */ |
203 | acpi_os_create_semaphore | ||
204 | (ACPI_NO_UNIT_LIMIT, 1, | ||
205 | &acpi_gbl_global_lock_semaphore); | ||
206 | if (ACPI_FAILURE(status)) { | ||
207 | acpi_ut_remove_reference | ||
208 | (obj_desc); | ||
209 | goto unlock_and_exit; | ||
210 | } | ||
211 | 209 | ||
212 | /* Mark this mutex as very special */ | 210 | if (ACPI_STRCMP(init_val->name, "_GL_") == 0) { |
211 | acpi_gbl_global_lock_mutex = | ||
212 | obj_desc->mutex.os_mutex; | ||
213 | 213 | ||
214 | obj_desc->mutex.os_mutex = | 214 | /* Create additional counting semaphore for global lock */ |
215 | ACPI_GLOBAL_LOCK; | ||
216 | } else { | ||
217 | /* Create a mutex */ | ||
218 | 215 | ||
219 | status = | 216 | status = |
220 | acpi_os_create_mutex(&obj_desc-> | 217 | acpi_os_create_semaphore(1, 1, |
221 | mutex. | 218 | &acpi_gbl_global_lock_semaphore); |
222 | os_mutex); | ||
223 | if (ACPI_FAILURE(status)) { | 219 | if (ACPI_FAILURE(status)) { |
224 | acpi_ut_remove_reference | 220 | acpi_ut_remove_reference |
225 | (obj_desc); | 221 | (obj_desc); |