aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/events/evgpeblk.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/events/evgpeblk.c')
-rw-r--r--drivers/acpi/events/evgpeblk.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/drivers/acpi/events/evgpeblk.c b/drivers/acpi/events/evgpeblk.c
index 87e77a138fff..e8e72986f0d6 100644
--- a/drivers/acpi/events/evgpeblk.c
+++ b/drivers/acpi/events/evgpeblk.c
@@ -207,7 +207,7 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
207 207
208 if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == 208 if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) ==
209 ACPI_GPE_DISPATCH_HANDLER) { 209 ACPI_GPE_DISPATCH_HANDLER) {
210 ACPI_MEM_FREE(gpe_event_info->dispatch.handler); 210 ACPI_FREE(gpe_event_info->dispatch.handler);
211 gpe_event_info->dispatch.handler = NULL; 211 gpe_event_info->dispatch.handler = NULL;
212 gpe_event_info->flags &= 212 gpe_event_info->flags &=
213 ~ACPI_GPE_DISPATCH_MASK; 213 ~ACPI_GPE_DISPATCH_MASK;
@@ -504,7 +504,7 @@ static struct acpi_gpe_xrupt_info *acpi_ev_get_gpe_xrupt_block(u32
504 504
505 /* Not found, must allocate a new xrupt descriptor */ 505 /* Not found, must allocate a new xrupt descriptor */
506 506
507 gpe_xrupt = ACPI_MEM_CALLOCATE(sizeof(struct acpi_gpe_xrupt_info)); 507 gpe_xrupt = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_gpe_xrupt_info));
508 if (!gpe_xrupt) { 508 if (!gpe_xrupt) {
509 return_PTR(NULL); 509 return_PTR(NULL);
510 } 510 }
@@ -595,7 +595,7 @@ acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt)
595 595
596 /* Free the block */ 596 /* Free the block */
597 597
598 ACPI_MEM_FREE(gpe_xrupt); 598 ACPI_FREE(gpe_xrupt);
599 return_ACPI_STATUS(AE_OK); 599 return_ACPI_STATUS(AE_OK);
600} 600}
601 601
@@ -712,9 +712,9 @@ acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block)
712 712
713 /* Free the gpe_block */ 713 /* Free the gpe_block */
714 714
715 ACPI_MEM_FREE(gpe_block->register_info); 715 ACPI_FREE(gpe_block->register_info);
716 ACPI_MEM_FREE(gpe_block->event_info); 716 ACPI_FREE(gpe_block->event_info);
717 ACPI_MEM_FREE(gpe_block); 717 ACPI_FREE(gpe_block);
718 718
719 unlock_and_exit: 719 unlock_and_exit:
720 status = acpi_ut_release_mutex(ACPI_MTX_EVENTS); 720 status = acpi_ut_release_mutex(ACPI_MTX_EVENTS);
@@ -748,10 +748,10 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
748 748
749 /* Allocate the GPE register information block */ 749 /* Allocate the GPE register information block */
750 750
751 gpe_register_info = ACPI_MEM_CALLOCATE((acpi_size) gpe_block-> 751 gpe_register_info = ACPI_ALLOCATE_ZEROED((acpi_size) gpe_block->
752 register_count * 752 register_count *
753 sizeof(struct 753 sizeof(struct
754 acpi_gpe_register_info)); 754 acpi_gpe_register_info));
755 if (!gpe_register_info) { 755 if (!gpe_register_info) {
756 ACPI_ERROR((AE_INFO, 756 ACPI_ERROR((AE_INFO,
757 "Could not allocate the gpe_register_info table")); 757 "Could not allocate the gpe_register_info table"));
@@ -762,10 +762,11 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
762 * Allocate the GPE event_info block. There are eight distinct GPEs 762 * Allocate the GPE event_info block. There are eight distinct GPEs
763 * per register. Initialization to zeros is sufficient. 763 * per register. Initialization to zeros is sufficient.
764 */ 764 */
765 gpe_event_info = ACPI_MEM_CALLOCATE(((acpi_size) gpe_block-> 765 gpe_event_info = ACPI_ALLOCATE_ZEROED(((acpi_size) gpe_block->
766 register_count * 766 register_count *
767 ACPI_GPE_REGISTER_WIDTH) * 767 ACPI_GPE_REGISTER_WIDTH) *
768 sizeof(struct acpi_gpe_event_info)); 768 sizeof(struct
769 acpi_gpe_event_info));
769 if (!gpe_event_info) { 770 if (!gpe_event_info) {
770 ACPI_ERROR((AE_INFO, 771 ACPI_ERROR((AE_INFO,
771 "Could not allocate the gpe_event_info table")); 772 "Could not allocate the gpe_event_info table"));
@@ -848,10 +849,10 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
848 849
849 error_exit: 850 error_exit:
850 if (gpe_register_info) { 851 if (gpe_register_info) {
851 ACPI_MEM_FREE(gpe_register_info); 852 ACPI_FREE(gpe_register_info);
852 } 853 }
853 if (gpe_event_info) { 854 if (gpe_event_info) {
854 ACPI_MEM_FREE(gpe_event_info); 855 ACPI_FREE(gpe_event_info);
855 } 856 }
856 857
857 return_ACPI_STATUS(status); 858 return_ACPI_STATUS(status);
@@ -895,7 +896,7 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
895 896
896 /* Allocate a new GPE block */ 897 /* Allocate a new GPE block */
897 898
898 gpe_block = ACPI_MEM_CALLOCATE(sizeof(struct acpi_gpe_block_info)); 899 gpe_block = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_gpe_block_info));
899 if (!gpe_block) { 900 if (!gpe_block) {
900 return_ACPI_STATUS(AE_NO_MEMORY); 901 return_ACPI_STATUS(AE_NO_MEMORY);
901 } 902 }
@@ -915,7 +916,7 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
915 */ 916 */
916 status = acpi_ev_create_gpe_info_blocks(gpe_block); 917 status = acpi_ev_create_gpe_info_blocks(gpe_block);
917 if (ACPI_FAILURE(status)) { 918 if (ACPI_FAILURE(status)) {
918 ACPI_MEM_FREE(gpe_block); 919 ACPI_FREE(gpe_block);
919 return_ACPI_STATUS(status); 920 return_ACPI_STATUS(status);
920 } 921 }
921 922
@@ -923,7 +924,7 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device,
923 924
924 status = acpi_ev_install_gpe_block(gpe_block, interrupt_number); 925 status = acpi_ev_install_gpe_block(gpe_block, interrupt_number);
925 if (ACPI_FAILURE(status)) { 926 if (ACPI_FAILURE(status)) {
926 ACPI_MEM_FREE(gpe_block); 927 ACPI_FREE(gpe_block);
927 return_ACPI_STATUS(status); 928 return_ACPI_STATUS(status);
928 } 929 }
929 930