aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/evxfevnt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/acpica/evxfevnt.c')
-rw-r--r--drivers/acpi/acpica/evxfevnt.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/acpi/acpica/evxfevnt.c b/drivers/acpi/acpica/evxfevnt.c
index 1aea1a734159..124c157215bf 100644
--- a/drivers/acpi/acpica/evxfevnt.c
+++ b/drivers/acpi/acpica/evxfevnt.c
@@ -235,7 +235,7 @@ acpi_status acpi_set_gpe(acpi_handle gpe_device, u32 gpe_number, u8 action)
235 235
236 switch (action) { 236 switch (action) {
237 case ACPI_GPE_ENABLE: 237 case ACPI_GPE_ENABLE:
238 status = acpi_ev_enable_gpe(gpe_event_info, TRUE); 238 status = acpi_ev_enable_gpe(gpe_event_info);
239 break; 239 break;
240 240
241 case ACPI_GPE_DISABLE: 241 case ACPI_GPE_DISABLE:
@@ -276,6 +276,9 @@ acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 type)
276 276
277 ACPI_FUNCTION_TRACE(acpi_enable_gpe); 277 ACPI_FUNCTION_TRACE(acpi_enable_gpe);
278 278
279 if (type & ~ACPI_GPE_TYPE_WAKE_RUN)
280 return_ACPI_STATUS(AE_BAD_PARAMETER);
281
279 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); 282 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
280 283
281 /* Ensure that we have a valid GPE number */ 284 /* Ensure that we have a valid GPE number */
@@ -287,11 +290,11 @@ acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 type)
287 } 290 }
288 291
289 if (type & ACPI_GPE_TYPE_RUNTIME) { 292 if (type & ACPI_GPE_TYPE_RUNTIME) {
290 if (++gpe_event_info->runtime_count == 1) 293 if (++gpe_event_info->runtime_count == 1) {
291 status = acpi_ev_enable_gpe(gpe_event_info, TRUE); 294 status = acpi_ev_enable_gpe(gpe_event_info);
292 295 if (ACPI_FAILURE(status))
293 if (ACPI_FAILURE(status)) 296 gpe_event_info->runtime_count--;
294 gpe_event_info->runtime_count--; 297 }
295 } 298 }
296 299
297 if (type & ACPI_GPE_TYPE_WAKE) { 300 if (type & ACPI_GPE_TYPE_WAKE) {
@@ -335,6 +338,9 @@ acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 type)
335 338
336 ACPI_FUNCTION_TRACE(acpi_disable_gpe); 339 ACPI_FUNCTION_TRACE(acpi_disable_gpe);
337 340
341 if (type & ~ACPI_GPE_TYPE_WAKE_RUN)
342 return_ACPI_STATUS(AE_BAD_PARAMETER);
343
338 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); 344 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
339 /* Ensure that we have a valid GPE number */ 345 /* Ensure that we have a valid GPE number */
340 346
@@ -344,12 +350,12 @@ acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u8 type)
344 goto unlock_and_exit; 350 goto unlock_and_exit;
345 } 351 }
346 352
347 if ((type & ACPI_GPE_TYPE_WAKE) && gpe_event_info->runtime_count) { 353 if ((type & ACPI_GPE_TYPE_RUNTIME) && gpe_event_info->runtime_count) {
348 if (--gpe_event_info->runtime_count == 0) 354 if (--gpe_event_info->runtime_count == 0)
349 acpi_ev_disable_gpe(gpe_event_info); 355 status = acpi_ev_disable_gpe(gpe_event_info);
350 } 356 }
351 357
352 if ((type & ACPI_GPE_TYPE_RUNTIME) && gpe_event_info->wakeup_count) { 358 if ((type & ACPI_GPE_TYPE_WAKE) && gpe_event_info->wakeup_count) {
353 /* 359 /*
354 * Wake-up GPEs are not enabled after leaving system sleep 360 * Wake-up GPEs are not enabled after leaving system sleep
355 * states, so we don't need to disable them here. 361 * states, so we don't need to disable them here.