diff options
author | Lv Zheng <lv.zheng@intel.com> | 2016-11-30 02:21:19 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-12-01 08:28:22 -0500 |
commit | 42cc87a55b0524b0ed178dd7949c52f9750711bc (patch) | |
tree | 42445cada946ee7a6955c3ab42c8e479327327af | |
parent | 760235cd6ca8ae0d7509055d75a0f1d8b3c60668 (diff) |
ACPICA: Tables: Cleanup acpi_tb_install_and_load_table()
ACPICA commit 7fdac0289faa1c28b91413c8e394e87372aa69e6
acpi_tb_install_and_load_table() can invoke acpi_tb_load_table() to eliminate
redundant code.
No functional change. Lv Zheng.
Link: https://github.com/acpica/acpica/commit/7fdac028
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/acpi/acpica/actables.h | 3 | ||||
-rw-r--r-- | drivers/acpi/acpica/exconfig.c | 7 | ||||
-rw-r--r-- | drivers/acpi/acpica/tbdata.c | 45 | ||||
-rw-r--r-- | drivers/acpi/acpica/tbxfload.c | 7 |
4 files changed, 12 insertions, 50 deletions
diff --git a/drivers/acpi/acpica/actables.h b/drivers/acpi/acpica/actables.h index e85953b6fa0e..1850005c5c7a 100644 --- a/drivers/acpi/acpica/actables.h +++ b/drivers/acpi/acpica/actables.h | |||
@@ -127,8 +127,7 @@ acpi_status | |||
127 | acpi_tb_load_table(u32 table_index, struct acpi_namespace_node *parent_node); | 127 | acpi_tb_load_table(u32 table_index, struct acpi_namespace_node *parent_node); |
128 | 128 | ||
129 | acpi_status | 129 | acpi_status |
130 | acpi_tb_install_and_load_table(struct acpi_table_header *table, | 130 | acpi_tb_install_and_load_table(acpi_physical_address address, |
131 | acpi_physical_address address, | ||
132 | u8 flags, u8 override, u32 *table_index); | 131 | u8 flags, u8 override, u32 *table_index); |
133 | 132 | ||
134 | void acpi_tb_terminate(void); | 133 | void acpi_tb_terminate(void); |
diff --git a/drivers/acpi/acpica/exconfig.c b/drivers/acpi/acpica/exconfig.c index 718428ba0b89..8b8d620e2656 100644 --- a/drivers/acpi/acpica/exconfig.c +++ b/drivers/acpi/acpica/exconfig.c | |||
@@ -437,10 +437,9 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc, | |||
437 | 437 | ||
438 | ACPI_INFO(("Dynamic OEM Table Load:")); | 438 | ACPI_INFO(("Dynamic OEM Table Load:")); |
439 | acpi_ex_exit_interpreter(); | 439 | acpi_ex_exit_interpreter(); |
440 | status = | 440 | status = acpi_tb_install_and_load_table(ACPI_PTR_TO_PHYSADDR(table), |
441 | acpi_tb_install_and_load_table(table, ACPI_PTR_TO_PHYSADDR(table), | 441 | ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, |
442 | ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, | 442 | TRUE, &table_index); |
443 | TRUE, &table_index); | ||
444 | acpi_ex_enter_interpreter(); | 443 | acpi_ex_enter_interpreter(); |
445 | if (ACPI_FAILURE(status)) { | 444 | if (ACPI_FAILURE(status)) { |
446 | 445 | ||
diff --git a/drivers/acpi/acpica/tbdata.c b/drivers/acpi/acpica/tbdata.c index d9ca8c2aa2d3..4cbfa30b6c05 100644 --- a/drivers/acpi/acpica/tbdata.c +++ b/drivers/acpi/acpica/tbdata.c | |||
@@ -832,9 +832,9 @@ acpi_tb_load_table(u32 table_index, struct acpi_namespace_node *parent_node) | |||
832 | * | 832 | * |
833 | * FUNCTION: acpi_tb_install_and_load_table | 833 | * FUNCTION: acpi_tb_install_and_load_table |
834 | * | 834 | * |
835 | * PARAMETERS: table - Pointer to the table | 835 | * PARAMETERS: address - Physical address of the table |
836 | * address - Physical address of the table | ||
837 | * flags - Allocation flags of the table | 836 | * flags - Allocation flags of the table |
837 | * override - Whether override should be performed | ||
838 | * table_index - Where table index is returned | 838 | * table_index - Where table index is returned |
839 | * | 839 | * |
840 | * RETURN: Status | 840 | * RETURN: Status |
@@ -844,15 +844,13 @@ acpi_tb_load_table(u32 table_index, struct acpi_namespace_node *parent_node) | |||
844 | ******************************************************************************/ | 844 | ******************************************************************************/ |
845 | 845 | ||
846 | acpi_status | 846 | acpi_status |
847 | acpi_tb_install_and_load_table(struct acpi_table_header *table, | 847 | acpi_tb_install_and_load_table(acpi_physical_address address, |
848 | acpi_physical_address address, | ||
849 | u8 flags, u8 override, u32 *table_index) | 848 | u8 flags, u8 override, u32 *table_index) |
850 | { | 849 | { |
851 | acpi_status status; | 850 | acpi_status status; |
852 | u32 i; | 851 | u32 i; |
853 | acpi_owner_id owner_id; | ||
854 | 852 | ||
855 | ACPI_FUNCTION_TRACE(acpi_load_table); | 853 | ACPI_FUNCTION_TRACE(tb_install_and_load_table); |
856 | 854 | ||
857 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | 855 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); |
858 | 856 | ||
@@ -864,41 +862,8 @@ acpi_tb_install_and_load_table(struct acpi_table_header *table, | |||
864 | goto unlock_and_exit; | 862 | goto unlock_and_exit; |
865 | } | 863 | } |
866 | 864 | ||
867 | /* | ||
868 | * Note: Now table is "INSTALLED", it must be validated before | ||
869 | * using. | ||
870 | */ | ||
871 | status = acpi_tb_validate_table(&acpi_gbl_root_table_list.tables[i]); | ||
872 | if (ACPI_FAILURE(status)) { | ||
873 | goto unlock_and_exit; | ||
874 | } | ||
875 | |||
876 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | 865 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); |
877 | status = acpi_ns_load_table(i, acpi_gbl_root_node); | 866 | status = acpi_tb_load_table(i, acpi_gbl_root_node); |
878 | |||
879 | /* Execute any module-level code that was found in the table */ | ||
880 | |||
881 | if (!acpi_gbl_parse_table_as_term_list | ||
882 | && acpi_gbl_group_module_level_code) { | ||
883 | acpi_ns_exec_module_code_list(); | ||
884 | } | ||
885 | |||
886 | /* | ||
887 | * Update GPEs for any new _Lxx/_Exx methods. Ignore errors. The host is | ||
888 | * responsible for discovering any new wake GPEs by running _PRW methods | ||
889 | * that may have been loaded by this table. | ||
890 | */ | ||
891 | status = acpi_tb_get_owner_id(i, &owner_id); | ||
892 | if (ACPI_SUCCESS(status)) { | ||
893 | acpi_ev_update_gpes(owner_id); | ||
894 | } | ||
895 | |||
896 | /* Invoke table handler if present */ | ||
897 | |||
898 | if (acpi_gbl_table_handler) { | ||
899 | (void)acpi_gbl_table_handler(ACPI_TABLE_EVENT_LOAD, table, | ||
900 | acpi_gbl_table_handler_context); | ||
901 | } | ||
902 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | 867 | (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); |
903 | 868 | ||
904 | unlock_and_exit: | 869 | unlock_and_exit: |
diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c index 2599e8314d94..77de33b76c85 100644 --- a/drivers/acpi/acpica/tbxfload.c +++ b/drivers/acpi/acpica/tbxfload.c | |||
@@ -330,10 +330,9 @@ acpi_status acpi_load_table(struct acpi_table_header *table) | |||
330 | /* Install the table and load it into the namespace */ | 330 | /* Install the table and load it into the namespace */ |
331 | 331 | ||
332 | ACPI_INFO(("Host-directed Dynamic ACPI Table Load:")); | 332 | ACPI_INFO(("Host-directed Dynamic ACPI Table Load:")); |
333 | status = | 333 | status = acpi_tb_install_and_load_table(ACPI_PTR_TO_PHYSADDR(table), |
334 | acpi_tb_install_and_load_table(table, ACPI_PTR_TO_PHYSADDR(table), | 334 | ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, |
335 | ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, | 335 | FALSE, &table_index); |
336 | FALSE, &table_index); | ||
337 | return_ACPI_STATUS(status); | 336 | return_ACPI_STATUS(status); |
338 | } | 337 | } |
339 | 338 | ||