diff options
Diffstat (limited to 'drivers/acpi/events/evgpeblk.c')
-rw-r--r-- | drivers/acpi/events/evgpeblk.c | 96 |
1 files changed, 55 insertions, 41 deletions
diff --git a/drivers/acpi/events/evgpeblk.c b/drivers/acpi/events/evgpeblk.c index 0fd00b5ad650..95ddeb48bc0f 100644 --- a/drivers/acpi/events/evgpeblk.c +++ b/drivers/acpi/events/evgpeblk.c | |||
@@ -131,14 +131,14 @@ u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info) | |||
131 | * | 131 | * |
132 | ******************************************************************************/ | 132 | ******************************************************************************/ |
133 | 133 | ||
134 | acpi_status acpi_ev_walk_gpe_list(ACPI_GPE_CALLBACK gpe_walk_callback) | 134 | acpi_status acpi_ev_walk_gpe_list(acpi_gpe_callback gpe_walk_callback) |
135 | { | 135 | { |
136 | struct acpi_gpe_block_info *gpe_block; | 136 | struct acpi_gpe_block_info *gpe_block; |
137 | struct acpi_gpe_xrupt_info *gpe_xrupt_info; | 137 | struct acpi_gpe_xrupt_info *gpe_xrupt_info; |
138 | acpi_status status = AE_OK; | 138 | acpi_status status = AE_OK; |
139 | acpi_cpu_flags flags; | 139 | acpi_cpu_flags flags; |
140 | 140 | ||
141 | ACPI_FUNCTION_TRACE("ev_walk_gpe_list"); | 141 | ACPI_FUNCTION_TRACE(ev_walk_gpe_list); |
142 | 142 | ||
143 | flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); | 143 | flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); |
144 | 144 | ||
@@ -146,10 +146,12 @@ acpi_status acpi_ev_walk_gpe_list(ACPI_GPE_CALLBACK gpe_walk_callback) | |||
146 | 146 | ||
147 | gpe_xrupt_info = acpi_gbl_gpe_xrupt_list_head; | 147 | gpe_xrupt_info = acpi_gbl_gpe_xrupt_list_head; |
148 | while (gpe_xrupt_info) { | 148 | while (gpe_xrupt_info) { |
149 | |||
149 | /* Walk all Gpe Blocks attached to this interrupt level */ | 150 | /* Walk all Gpe Blocks attached to this interrupt level */ |
150 | 151 | ||
151 | gpe_block = gpe_xrupt_info->gpe_block_list_head; | 152 | gpe_block = gpe_xrupt_info->gpe_block_list_head; |
152 | while (gpe_block) { | 153 | while (gpe_block) { |
154 | |||
153 | /* One callback per GPE block */ | 155 | /* One callback per GPE block */ |
154 | 156 | ||
155 | status = gpe_walk_callback(gpe_xrupt_info, gpe_block); | 157 | status = gpe_walk_callback(gpe_xrupt_info, gpe_block); |
@@ -190,11 +192,12 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info, | |||
190 | acpi_native_uint i; | 192 | acpi_native_uint i; |
191 | acpi_native_uint j; | 193 | acpi_native_uint j; |
192 | 194 | ||
193 | ACPI_FUNCTION_TRACE("ev_delete_gpe_handlers"); | 195 | ACPI_FUNCTION_TRACE(ev_delete_gpe_handlers); |
194 | 196 | ||
195 | /* Examine each GPE Register within the block */ | 197 | /* Examine each GPE Register within the block */ |
196 | 198 | ||
197 | for (i = 0; i < gpe_block->register_count; i++) { | 199 | for (i = 0; i < gpe_block->register_count; i++) { |
200 | |||
198 | /* Now look at the individual GPEs in this byte register */ | 201 | /* Now look at the individual GPEs in this byte register */ |
199 | 202 | ||
200 | for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) { | 203 | for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) { |
@@ -204,7 +207,7 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info, | |||
204 | 207 | ||
205 | if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == | 208 | if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == |
206 | ACPI_GPE_DISPATCH_HANDLER) { | 209 | ACPI_GPE_DISPATCH_HANDLER) { |
207 | ACPI_MEM_FREE(gpe_event_info->dispatch.handler); | 210 | ACPI_FREE(gpe_event_info->dispatch.handler); |
208 | gpe_event_info->dispatch.handler = NULL; | 211 | gpe_event_info->dispatch.handler = NULL; |
209 | gpe_event_info->flags &= | 212 | gpe_event_info->flags &= |
210 | ~ACPI_GPE_DISPATCH_MASK; | 213 | ~ACPI_GPE_DISPATCH_MASK; |
@@ -248,7 +251,7 @@ acpi_ev_save_method_info(acpi_handle obj_handle, | |||
248 | u8 type; | 251 | u8 type; |
249 | acpi_status status; | 252 | acpi_status status; |
250 | 253 | ||
251 | ACPI_FUNCTION_TRACE("ev_save_method_info"); | 254 | ACPI_FUNCTION_TRACE(ev_save_method_info); |
252 | 255 | ||
253 | /* | 256 | /* |
254 | * _Lxx and _Exx GPE method support | 257 | * _Lxx and _Exx GPE method support |
@@ -279,9 +282,9 @@ acpi_ev_save_method_info(acpi_handle obj_handle, | |||
279 | default: | 282 | default: |
280 | /* Unknown method type, just ignore it! */ | 283 | /* Unknown method type, just ignore it! */ |
281 | 284 | ||
282 | ACPI_ERROR((AE_INFO, | 285 | ACPI_DEBUG_PRINT((ACPI_DB_LOAD, |
283 | "Unknown GPE method type: %s (name not of form _Lxx or _Exx)", | 286 | "Ignoring unknown GPE method type: %s (name not of form _Lxx or _Exx)", |
284 | name)); | 287 | name)); |
285 | return_ACPI_STATUS(AE_OK); | 288 | return_ACPI_STATUS(AE_OK); |
286 | } | 289 | } |
287 | 290 | ||
@@ -289,11 +292,12 @@ acpi_ev_save_method_info(acpi_handle obj_handle, | |||
289 | 292 | ||
290 | gpe_number = ACPI_STRTOUL(&name[2], NULL, 16); | 293 | gpe_number = ACPI_STRTOUL(&name[2], NULL, 16); |
291 | if (gpe_number == ACPI_UINT32_MAX) { | 294 | if (gpe_number == ACPI_UINT32_MAX) { |
295 | |||
292 | /* Conversion failed; invalid method, just ignore it */ | 296 | /* Conversion failed; invalid method, just ignore it */ |
293 | 297 | ||
294 | ACPI_ERROR((AE_INFO, | 298 | ACPI_DEBUG_PRINT((ACPI_DB_LOAD, |
295 | "Could not extract GPE number from name: %s (name is not of form _Lxx or _Exx)", | 299 | "Could not extract GPE number from name: %s (name is not of form _Lxx or _Exx)", |
296 | name)); | 300 | name)); |
297 | return_ACPI_STATUS(AE_OK); | 301 | return_ACPI_STATUS(AE_OK); |
298 | } | 302 | } |
299 | 303 | ||
@@ -364,13 +368,14 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle, | |||
364 | u32 gpe_number; | 368 | u32 gpe_number; |
365 | acpi_status status; | 369 | acpi_status status; |
366 | 370 | ||
367 | ACPI_FUNCTION_TRACE("ev_match_prw_and_gpe"); | 371 | ACPI_FUNCTION_TRACE(ev_match_prw_and_gpe); |
368 | 372 | ||
369 | /* Check for a _PRW method under this device */ | 373 | /* Check for a _PRW method under this device */ |
370 | 374 | ||
371 | status = acpi_ut_evaluate_object(obj_handle, METHOD_NAME__PRW, | 375 | status = acpi_ut_evaluate_object(obj_handle, METHOD_NAME__PRW, |
372 | ACPI_BTYPE_PACKAGE, &pkg_desc); | 376 | ACPI_BTYPE_PACKAGE, &pkg_desc); |
373 | if (ACPI_FAILURE(status)) { | 377 | if (ACPI_FAILURE(status)) { |
378 | |||
374 | /* Ignore all errors from _PRW, we don't want to abort the subsystem */ | 379 | /* Ignore all errors from _PRW, we don't want to abort the subsystem */ |
375 | 380 | ||
376 | return_ACPI_STATUS(AE_OK); | 381 | return_ACPI_STATUS(AE_OK); |
@@ -394,6 +399,7 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle, | |||
394 | obj_desc = pkg_desc->package.elements[0]; | 399 | obj_desc = pkg_desc->package.elements[0]; |
395 | 400 | ||
396 | if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) { | 401 | if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) { |
402 | |||
397 | /* Use FADT-defined GPE device (from definition of _PRW) */ | 403 | /* Use FADT-defined GPE device (from definition of _PRW) */ |
398 | 404 | ||
399 | target_gpe_device = acpi_gbl_fadt_gpe_device; | 405 | target_gpe_device = acpi_gbl_fadt_gpe_device; |
@@ -402,6 +408,7 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle, | |||
402 | 408 | ||
403 | gpe_number = (u32) obj_desc->integer.value; | 409 | gpe_number = (u32) obj_desc->integer.value; |
404 | } else if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_PACKAGE) { | 410 | } else if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_PACKAGE) { |
411 | |||
405 | /* Package contains a GPE reference and GPE number within a GPE block */ | 412 | /* Package contains a GPE reference and GPE number within a GPE block */ |
406 | 413 | ||
407 | if ((obj_desc->package.count < 2) || | 414 | if ((obj_desc->package.count < 2) || |
@@ -482,7 +489,7 @@ static struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 | |||
482 | acpi_status status; | 489 | acpi_status status; |
483 | acpi_cpu_flags flags; | 490 | acpi_cpu_flags flags; |
484 | 491 | ||
485 | ACPI_FUNCTION_TRACE("ev_get_gpe_xrupt_block"); | 492 | ACPI_FUNCTION_TRACE(ev_get_gpe_xrupt_block); |
486 | 493 | ||
487 | /* No need for lock since we are not changing any list elements here */ | 494 | /* No need for lock since we are not changing any list elements here */ |
488 | 495 | ||
@@ -497,7 +504,7 @@ static struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32 | |||
497 | 504 | ||
498 | /* Not found, must allocate a new xrupt descriptor */ | 505 | /* Not found, must allocate a new xrupt descriptor */ |
499 | 506 | ||
500 | gpe_xrupt = ACPI_MEM_CALLOCATE(sizeof(struct acpi_gpe_xrupt_info)); | 507 | gpe_xrupt = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_gpe_xrupt_info)); |
501 | if (!gpe_xrupt) { | 508 | if (!gpe_xrupt) { |
502 | return_PTR(NULL); | 509 | return_PTR(NULL); |
503 | } | 510 | } |
@@ -556,7 +563,7 @@ acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt) | |||
556 | acpi_status status; | 563 | acpi_status status; |
557 | acpi_cpu_flags flags; | 564 | acpi_cpu_flags flags; |
558 | 565 | ||
559 | ACPI_FUNCTION_TRACE("ev_delete_gpe_xrupt"); | 566 | ACPI_FUNCTION_TRACE(ev_delete_gpe_xrupt); |
560 | 567 | ||
561 | /* We never want to remove the SCI interrupt handler */ | 568 | /* We never want to remove the SCI interrupt handler */ |
562 | 569 | ||
@@ -588,7 +595,7 @@ acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt) | |||
588 | 595 | ||
589 | /* Free the block */ | 596 | /* Free the block */ |
590 | 597 | ||
591 | ACPI_MEM_FREE(gpe_xrupt); | 598 | ACPI_FREE(gpe_xrupt); |
592 | return_ACPI_STATUS(AE_OK); | 599 | return_ACPI_STATUS(AE_OK); |
593 | } | 600 | } |
594 | 601 | ||
@@ -614,7 +621,7 @@ acpi_ev_install_gpe_block(struct acpi_gpe_block_info *gpe_block, | |||
614 | acpi_status status; | 621 | acpi_status status; |
615 | acpi_cpu_flags flags; | 622 | acpi_cpu_flags flags; |
616 | 623 | ||
617 | ACPI_FUNCTION_TRACE("ev_install_gpe_block"); | 624 | ACPI_FUNCTION_TRACE(ev_install_gpe_block); |
618 | 625 | ||
619 | status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); | 626 | status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); |
620 | if (ACPI_FAILURE(status)) { | 627 | if (ACPI_FAILURE(status)) { |
@@ -667,7 +674,7 @@ acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block) | |||
667 | acpi_status status; | 674 | acpi_status status; |
668 | acpi_cpu_flags flags; | 675 | acpi_cpu_flags flags; |
669 | 676 | ||
670 | ACPI_FUNCTION_TRACE("ev_install_gpe_block"); | 677 | ACPI_FUNCTION_TRACE(ev_install_gpe_block); |
671 | 678 | ||
672 | status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); | 679 | status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); |
673 | if (ACPI_FAILURE(status)) { | 680 | if (ACPI_FAILURE(status)) { |
@@ -679,6 +686,7 @@ acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block) | |||
679 | status = acpi_hw_disable_gpe_block(gpe_block->xrupt_block, gpe_block); | 686 | status = acpi_hw_disable_gpe_block(gpe_block->xrupt_block, gpe_block); |
680 | 687 | ||
681 | if (!gpe_block->previous && !gpe_block->next) { | 688 | if (!gpe_block->previous && !gpe_block->next) { |
689 | |||
682 | /* This is the last gpe_block on this interrupt */ | 690 | /* This is the last gpe_block on this interrupt */ |
683 | 691 | ||
684 | status = acpi_ev_delete_gpe_xrupt(gpe_block->xrupt_block); | 692 | status = acpi_ev_delete_gpe_xrupt(gpe_block->xrupt_block); |
@@ -704,9 +712,9 @@ acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block) | |||
704 | 712 | ||
705 | /* Free the gpe_block */ | 713 | /* Free the gpe_block */ |
706 | 714 | ||
707 | ACPI_MEM_FREE(gpe_block->register_info); | 715 | ACPI_FREE(gpe_block->register_info); |
708 | ACPI_MEM_FREE(gpe_block->event_info); | 716 | ACPI_FREE(gpe_block->event_info); |
709 | ACPI_MEM_FREE(gpe_block); | 717 | ACPI_FREE(gpe_block); |
710 | 718 | ||
711 | unlock_and_exit: | 719 | unlock_and_exit: |
712 | status = acpi_ut_release_mutex(ACPI_MTX_EVENTS); | 720 | status = acpi_ut_release_mutex(ACPI_MTX_EVENTS); |
@@ -736,17 +744,17 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block) | |||
736 | acpi_native_uint j; | 744 | acpi_native_uint j; |
737 | acpi_status status; | 745 | acpi_status status; |
738 | 746 | ||
739 | ACPI_FUNCTION_TRACE("ev_create_gpe_info_blocks"); | 747 | ACPI_FUNCTION_TRACE(ev_create_gpe_info_blocks); |
740 | 748 | ||
741 | /* Allocate the GPE register information block */ | 749 | /* Allocate the GPE register information block */ |
742 | 750 | ||
743 | gpe_register_info = ACPI_MEM_CALLOCATE((acpi_size) gpe_block-> | 751 | gpe_register_info = ACPI_ALLOCATE_ZEROED((acpi_size) gpe_block-> |
744 | register_count * | 752 | register_count * |
745 | sizeof(struct | 753 | sizeof(struct |
746 | acpi_gpe_register_info)); | 754 | acpi_gpe_register_info)); |
747 | if (!gpe_register_info) { | 755 | if (!gpe_register_info) { |
748 | ACPI_ERROR((AE_INFO, | 756 | ACPI_ERROR((AE_INFO, |
749 | "Could not allocate the gpe_register_info table")); | 757 | "Could not allocate the GpeRegisterInfo table")); |
750 | return_ACPI_STATUS(AE_NO_MEMORY); | 758 | return_ACPI_STATUS(AE_NO_MEMORY); |
751 | } | 759 | } |
752 | 760 | ||
@@ -754,13 +762,14 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block) | |||
754 | * Allocate the GPE event_info block. There are eight distinct GPEs | 762 | * Allocate the GPE event_info block. There are eight distinct GPEs |
755 | * per register. Initialization to zeros is sufficient. | 763 | * per register. Initialization to zeros is sufficient. |
756 | */ | 764 | */ |
757 | gpe_event_info = ACPI_MEM_CALLOCATE(((acpi_size) gpe_block-> | 765 | gpe_event_info = ACPI_ALLOCATE_ZEROED(((acpi_size) gpe_block-> |
758 | register_count * | 766 | register_count * |
759 | ACPI_GPE_REGISTER_WIDTH) * | 767 | ACPI_GPE_REGISTER_WIDTH) * |
760 | sizeof(struct acpi_gpe_event_info)); | 768 | sizeof(struct |
769 | acpi_gpe_event_info)); | ||
761 | if (!gpe_event_info) { | 770 | if (!gpe_event_info) { |
762 | ACPI_ERROR((AE_INFO, | 771 | ACPI_ERROR((AE_INFO, |
763 | "Could not allocate the gpe_event_info table")); | 772 | "Could not allocate the GpeEventInfo table")); |
764 | status = AE_NO_MEMORY; | 773 | status = AE_NO_MEMORY; |
765 | goto error_exit; | 774 | goto error_exit; |
766 | } | 775 | } |
@@ -780,6 +789,7 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block) | |||
780 | this_event = gpe_event_info; | 789 | this_event = gpe_event_info; |
781 | 790 | ||
782 | for (i = 0; i < gpe_block->register_count; i++) { | 791 | for (i = 0; i < gpe_block->register_count; i++) { |
792 | |||
783 | /* Init the register_info for this GPE register (8 GPEs) */ | 793 | /* Init the register_info for this GPE register (8 GPEs) */ |
784 | 794 | ||
785 | this_register->base_gpe_number = | 795 | this_register->base_gpe_number = |
@@ -839,10 +849,10 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block) | |||
839 | 849 | ||
840 | error_exit: | 850 | error_exit: |
841 | if (gpe_register_info) { | 851 | if (gpe_register_info) { |
842 | ACPI_MEM_FREE(gpe_register_info); | 852 | ACPI_FREE(gpe_register_info); |
843 | } | 853 | } |
844 | if (gpe_event_info) { | 854 | if (gpe_event_info) { |
845 | ACPI_MEM_FREE(gpe_event_info); | 855 | ACPI_FREE(gpe_event_info); |
846 | } | 856 | } |
847 | 857 | ||
848 | return_ACPI_STATUS(status); | 858 | return_ACPI_STATUS(status); |
@@ -878,7 +888,7 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device, | |||
878 | acpi_status status; | 888 | acpi_status status; |
879 | struct acpi_gpe_block_info *gpe_block; | 889 | struct acpi_gpe_block_info *gpe_block; |
880 | 890 | ||
881 | ACPI_FUNCTION_TRACE("ev_create_gpe_block"); | 891 | ACPI_FUNCTION_TRACE(ev_create_gpe_block); |
882 | 892 | ||
883 | if (!register_count) { | 893 | if (!register_count) { |
884 | return_ACPI_STATUS(AE_OK); | 894 | return_ACPI_STATUS(AE_OK); |
@@ -886,7 +896,7 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device, | |||
886 | 896 | ||
887 | /* Allocate a new GPE block */ | 897 | /* Allocate a new GPE block */ |
888 | 898 | ||
889 | gpe_block = ACPI_MEM_CALLOCATE(sizeof(struct acpi_gpe_block_info)); | 899 | gpe_block = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_gpe_block_info)); |
890 | if (!gpe_block) { | 900 | if (!gpe_block) { |
891 | return_ACPI_STATUS(AE_NO_MEMORY); | 901 | return_ACPI_STATUS(AE_NO_MEMORY); |
892 | } | 902 | } |
@@ -906,7 +916,7 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device, | |||
906 | */ | 916 | */ |
907 | status = acpi_ev_create_gpe_info_blocks(gpe_block); | 917 | status = acpi_ev_create_gpe_info_blocks(gpe_block); |
908 | if (ACPI_FAILURE(status)) { | 918 | if (ACPI_FAILURE(status)) { |
909 | ACPI_MEM_FREE(gpe_block); | 919 | ACPI_FREE(gpe_block); |
910 | return_ACPI_STATUS(status); | 920 | return_ACPI_STATUS(status); |
911 | } | 921 | } |
912 | 922 | ||
@@ -914,7 +924,7 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device, | |||
914 | 924 | ||
915 | status = acpi_ev_install_gpe_block(gpe_block, interrupt_number); | 925 | status = acpi_ev_install_gpe_block(gpe_block, interrupt_number); |
916 | if (ACPI_FAILURE(status)) { | 926 | if (ACPI_FAILURE(status)) { |
917 | ACPI_MEM_FREE(gpe_block); | 927 | ACPI_FREE(gpe_block); |
918 | return_ACPI_STATUS(status); | 928 | return_ACPI_STATUS(status); |
919 | } | 929 | } |
920 | 930 | ||
@@ -971,7 +981,7 @@ acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device, | |||
971 | acpi_native_uint i; | 981 | acpi_native_uint i; |
972 | acpi_native_uint j; | 982 | acpi_native_uint j; |
973 | 983 | ||
974 | ACPI_FUNCTION_TRACE("ev_initialize_gpe_block"); | 984 | ACPI_FUNCTION_TRACE(ev_initialize_gpe_block); |
975 | 985 | ||
976 | /* Ignore a null GPE block (e.g., if no GPE block 1 exists) */ | 986 | /* Ignore a null GPE block (e.g., if no GPE block 1 exists) */ |
977 | 987 | ||
@@ -1013,6 +1023,7 @@ acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device, | |||
1013 | 1023 | ||
1014 | for (i = 0; i < gpe_block->register_count; i++) { | 1024 | for (i = 0; i < gpe_block->register_count; i++) { |
1015 | for (j = 0; j < 8; j++) { | 1025 | for (j = 0; j < 8; j++) { |
1026 | |||
1016 | /* Get the info block for this particular GPE */ | 1027 | /* Get the info block for this particular GPE */ |
1017 | 1028 | ||
1018 | gpe_event_info = | 1029 | gpe_event_info = |
@@ -1040,7 +1051,7 @@ acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device, | |||
1040 | 1051 | ||
1041 | status = acpi_hw_enable_runtime_gpe_block(NULL, gpe_block); | 1052 | status = acpi_hw_enable_runtime_gpe_block(NULL, gpe_block); |
1042 | if (ACPI_FAILURE(status)) { | 1053 | if (ACPI_FAILURE(status)) { |
1043 | ACPI_ERROR((AE_INFO, "Could not enable GPEs in gpe_block %p", | 1054 | ACPI_ERROR((AE_INFO, "Could not enable GPEs in GpeBlock %p", |
1044 | gpe_block)); | 1055 | gpe_block)); |
1045 | } | 1056 | } |
1046 | 1057 | ||
@@ -1066,7 +1077,7 @@ acpi_status acpi_ev_gpe_initialize(void) | |||
1066 | u32 gpe_number_max = 0; | 1077 | u32 gpe_number_max = 0; |
1067 | acpi_status status; | 1078 | acpi_status status; |
1068 | 1079 | ||
1069 | ACPI_FUNCTION_TRACE("ev_gpe_initialize"); | 1080 | ACPI_FUNCTION_TRACE(ev_gpe_initialize); |
1070 | 1081 | ||
1071 | status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); | 1082 | status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); |
1072 | if (ACPI_FAILURE(status)) { | 1083 | if (ACPI_FAILURE(status)) { |
@@ -1099,6 +1110,7 @@ acpi_status acpi_ev_gpe_initialize(void) | |||
1099 | * particular block is not supported. | 1110 | * particular block is not supported. |
1100 | */ | 1111 | */ |
1101 | if (acpi_gbl_FADT->gpe0_blk_len && acpi_gbl_FADT->xgpe0_blk.address) { | 1112 | if (acpi_gbl_FADT->gpe0_blk_len && acpi_gbl_FADT->xgpe0_blk.address) { |
1113 | |||
1102 | /* GPE block 0 exists (has both length and address > 0) */ | 1114 | /* GPE block 0 exists (has both length and address > 0) */ |
1103 | 1115 | ||
1104 | register_count0 = (u16) (acpi_gbl_FADT->gpe0_blk_len / 2); | 1116 | register_count0 = (u16) (acpi_gbl_FADT->gpe0_blk_len / 2); |
@@ -1121,6 +1133,7 @@ acpi_status acpi_ev_gpe_initialize(void) | |||
1121 | } | 1133 | } |
1122 | 1134 | ||
1123 | if (acpi_gbl_FADT->gpe1_blk_len && acpi_gbl_FADT->xgpe1_blk.address) { | 1135 | if (acpi_gbl_FADT->gpe1_blk_len && acpi_gbl_FADT->xgpe1_blk.address) { |
1136 | |||
1124 | /* GPE block 1 exists (has both length and address > 0) */ | 1137 | /* GPE block 1 exists (has both length and address > 0) */ |
1125 | 1138 | ||
1126 | register_count1 = (u16) (acpi_gbl_FADT->gpe1_blk_len / 2); | 1139 | register_count1 = (u16) (acpi_gbl_FADT->gpe1_blk_len / 2); |
@@ -1168,6 +1181,7 @@ acpi_status acpi_ev_gpe_initialize(void) | |||
1168 | /* Exit if there are no GPE registers */ | 1181 | /* Exit if there are no GPE registers */ |
1169 | 1182 | ||
1170 | if ((register_count0 + register_count1) == 0) { | 1183 | if ((register_count0 + register_count1) == 0) { |
1184 | |||
1171 | /* GPEs are not required by ACPI, this is OK */ | 1185 | /* GPEs are not required by ACPI, this is OK */ |
1172 | 1186 | ||
1173 | ACPI_DEBUG_PRINT((ACPI_DB_INIT, | 1187 | ACPI_DEBUG_PRINT((ACPI_DB_INIT, |