diff options
-rw-r--r-- | drivers/acpi/ec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 8ef74e7b3b91..4d17777110ed 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
@@ -286,12 +286,12 @@ static int acpi_ec_transaction(struct acpi_ec *ec, u8 command, | |||
286 | if (rdata) | 286 | if (rdata) |
287 | memset(rdata, 0, rdata_len); | 287 | memset(rdata, 0, rdata_len); |
288 | 288 | ||
289 | mutex_lock(&ec->lock); | ||
289 | if (ec->global_lock) { | 290 | if (ec->global_lock) { |
290 | status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); | 291 | status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); |
291 | if (ACPI_FAILURE(status)) | 292 | if (ACPI_FAILURE(status)) |
292 | return -ENODEV; | 293 | return -ENODEV; |
293 | } | 294 | } |
294 | mutex_lock(&ec->lock); | ||
295 | 295 | ||
296 | /* Make sure GPE is enabled before doing transaction */ | 296 | /* Make sure GPE is enabled before doing transaction */ |
297 | acpi_enable_gpe(NULL, ec->gpe, ACPI_NOT_ISR); | 297 | acpi_enable_gpe(NULL, ec->gpe, ACPI_NOT_ISR); |
@@ -307,10 +307,10 @@ static int acpi_ec_transaction(struct acpi_ec *ec, u8 command, | |||
307 | rdata, rdata_len); | 307 | rdata, rdata_len); |
308 | 308 | ||
309 | end: | 309 | end: |
310 | mutex_unlock(&ec->lock); | ||
311 | 310 | ||
312 | if (ec->global_lock) | 311 | if (ec->global_lock) |
313 | acpi_release_global_lock(glk); | 312 | acpi_release_global_lock(glk); |
313 | mutex_unlock(&ec->lock); | ||
314 | 314 | ||
315 | return status; | 315 | return status; |
316 | } | 316 | } |