diff options
-rw-r--r-- | drivers/acpi/acpica/actables.h | 2 | ||||
-rw-r--r-- | drivers/acpi/acpica/tbdata.c | 43 | ||||
-rw-r--r-- | drivers/acpi/acpica/tbinstal.c | 8 |
3 files changed, 33 insertions, 20 deletions
diff --git a/drivers/acpi/acpica/actables.h b/drivers/acpi/acpica/actables.h index c8da453bd960..89ed31b0f739 100644 --- a/drivers/acpi/acpica/actables.h +++ b/drivers/acpi/acpica/actables.h | |||
@@ -132,6 +132,8 @@ acpi_tb_install_and_load_table(acpi_physical_address address, | |||
132 | 132 | ||
133 | acpi_status acpi_tb_unload_table(u32 table_index); | 133 | acpi_status acpi_tb_unload_table(u32 table_index); |
134 | 134 | ||
135 | void acpi_tb_notify_table(u32 event, void *table); | ||
136 | |||
135 | void acpi_tb_terminate(void); | 137 | void acpi_tb_terminate(void); |
136 | 138 | ||
137 | acpi_status acpi_tb_delete_namespace_by_owner(u32 table_index); | 139 | acpi_status acpi_tb_delete_namespace_by_owner(u32 table_index); |
diff --git a/drivers/acpi/acpica/tbdata.c b/drivers/acpi/acpica/tbdata.c index c9d6fa6d7cc6..7056ca01e875 100644 --- a/drivers/acpi/acpica/tbdata.c +++ b/drivers/acpi/acpica/tbdata.c | |||
@@ -818,13 +818,9 @@ acpi_tb_load_table(u32 table_index, struct acpi_namespace_node *parent_node) | |||
818 | acpi_ev_update_gpes(owner_id); | 818 | acpi_ev_update_gpes(owner_id); |
819 | } | 819 | } |
820 | 820 | ||
821 | /* Invoke table handler if present */ | 821 | /* Invoke table handler */ |
822 | |||
823 | if (acpi_gbl_table_handler) { | ||
824 | (void)acpi_gbl_table_handler(ACPI_TABLE_EVENT_LOAD, table, | ||
825 | acpi_gbl_table_handler_context); | ||
826 | } | ||
827 | 822 | ||
823 | acpi_tb_notify_table(ACPI_TABLE_EVENT_LOAD, table); | ||
828 | return_ACPI_STATUS(status); | 824 | return_ACPI_STATUS(status); |
829 | } | 825 | } |
830 | 826 | ||
@@ -894,15 +890,11 @@ acpi_status acpi_tb_unload_table(u32 table_index) | |||
894 | return_ACPI_STATUS(AE_NOT_EXIST); | 890 | return_ACPI_STATUS(AE_NOT_EXIST); |
895 | } | 891 | } |
896 | 892 | ||
897 | /* Invoke table handler if present */ | 893 | /* Invoke table handler */ |
898 | 894 | ||
899 | if (acpi_gbl_table_handler) { | 895 | status = acpi_get_table_by_index(table_index, &table); |
900 | status = acpi_get_table_by_index(table_index, &table); | 896 | if (ACPI_SUCCESS(status)) { |
901 | if (ACPI_SUCCESS(status)) { | 897 | acpi_tb_notify_table(ACPI_TABLE_EVENT_UNLOAD, table); |
902 | (void)acpi_gbl_table_handler(ACPI_TABLE_EVENT_UNLOAD, | ||
903 | table, | ||
904 | acpi_gbl_table_handler_context); | ||
905 | } | ||
906 | } | 898 | } |
907 | 899 | ||
908 | /* Delete the portion of the namespace owned by this table */ | 900 | /* Delete the portion of the namespace owned by this table */ |
@@ -918,3 +910,26 @@ acpi_status acpi_tb_unload_table(u32 table_index) | |||
918 | } | 910 | } |
919 | 911 | ||
920 | ACPI_EXPORT_SYMBOL(acpi_tb_unload_table) | 912 | ACPI_EXPORT_SYMBOL(acpi_tb_unload_table) |
913 | |||
914 | /******************************************************************************* | ||
915 | * | ||
916 | * FUNCTION: acpi_tb_notify_table | ||
917 | * | ||
918 | * PARAMETERS: event - Table event | ||
919 | * table - Validated table pointer | ||
920 | * | ||
921 | * RETURN: None | ||
922 | * | ||
923 | * DESCRIPTION: Notify a table event to the users. | ||
924 | * | ||
925 | ******************************************************************************/ | ||
926 | |||
927 | void acpi_tb_notify_table(u32 event, void *table) | ||
928 | { | ||
929 | /* Invoke table handler if present */ | ||
930 | |||
931 | if (acpi_gbl_table_handler) { | ||
932 | (void)acpi_gbl_table_handler(event, table, | ||
933 | acpi_gbl_table_handler_context); | ||
934 | } | ||
935 | } | ||
diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c index 4620f3c68c13..ee745152f25b 100644 --- a/drivers/acpi/acpica/tbinstal.c +++ b/drivers/acpi/acpica/tbinstal.c | |||
@@ -306,14 +306,10 @@ acpi_tb_install_standard_table(acpi_physical_address address, | |||
306 | acpi_tb_install_table_with_override(&new_table_desc, override, | 306 | acpi_tb_install_table_with_override(&new_table_desc, override, |
307 | table_index); | 307 | table_index); |
308 | 308 | ||
309 | /* Invoke table handler if present */ | 309 | /* Invoke table handler */ |
310 | 310 | ||
311 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | 311 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); |
312 | if (acpi_gbl_table_handler) { | 312 | acpi_tb_notify_table(ACPI_TABLE_EVENT_INSTALL, new_table_desc.pointer); |
313 | (void)acpi_gbl_table_handler(ACPI_TABLE_EVENT_INSTALL, | ||
314 | new_table_desc.pointer, | ||
315 | acpi_gbl_table_handler_context); | ||
316 | } | ||
317 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | 313 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); |
318 | 314 | ||
319 | unlock_and_exit: | 315 | unlock_and_exit: |