diff options
author | Bob Moore <robert.moore@intel.com> | 2016-12-28 02:29:49 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-01-04 20:48:22 -0500 |
commit | 9a947291374dbf377c4110f2387f3386d88cf5b0 (patch) | |
tree | f726aad36013e942b93f2f4a9316617ab30b6206 | |
parent | ce87e09dd88c61f9088768a7708828423549725c (diff) |
ACPICA: Fix a problem with recent extra support for control method invocations
ACPICA commit b7dae343fbb8c392999a66f5e08be5744a5d07e2
This change fixes a problem with the recent support that enables
control method invocations as Target operands to many ASL
operators. Eliminates errors similar to:
Needed type [Reference], found [Processor]
Link: https://github.com/acpica/acpica/commit/b7dae343
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/acpi/acpica/psargs.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/acpi/acpica/psargs.c b/drivers/acpi/acpica/psargs.c index 4e1065e84da8..b0e55a7d4bdf 100644 --- a/drivers/acpi/acpica/psargs.c +++ b/drivers/acpi/acpica/psargs.c | |||
@@ -269,6 +269,20 @@ acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state, | |||
269 | */ | 269 | */ |
270 | if (ACPI_SUCCESS(status) && | 270 | if (ACPI_SUCCESS(status) && |
271 | possible_method_call && (node->type == ACPI_TYPE_METHOD)) { | 271 | possible_method_call && (node->type == ACPI_TYPE_METHOD)) { |
272 | if ((GET_CURRENT_ARG_TYPE(walk_state->arg_types) == | ||
273 | ARGP_SUPERNAME) | ||
274 | || (GET_CURRENT_ARG_TYPE(walk_state->arg_types) == | ||
275 | ARGP_TARGET)) { | ||
276 | /* | ||
277 | * acpi_ps_get_next_namestring has increased the AML pointer past | ||
278 | * the method invocation namestring, so we need to restore the | ||
279 | * saved AML pointer back to the original method invocation | ||
280 | * namestring. | ||
281 | */ | ||
282 | walk_state->parser_state.aml = start; | ||
283 | walk_state->arg_count = 1; | ||
284 | acpi_ps_init_op(arg, AML_INT_METHODCALL_OP); | ||
285 | } | ||
272 | 286 | ||
273 | /* This name is actually a control method invocation */ | 287 | /* This name is actually a control method invocation */ |
274 | 288 | ||
@@ -833,7 +847,10 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state, | |||
833 | arg_type)); | 847 | arg_type)); |
834 | 848 | ||
835 | subop = acpi_ps_peek_opcode(parser_state); | 849 | subop = acpi_ps_peek_opcode(parser_state); |
836 | if (subop == 0) { | 850 | if (subop == 0 || |
851 | acpi_ps_is_leading_char(subop) || | ||
852 | ACPI_IS_ROOT_PREFIX(subop) || | ||
853 | ACPI_IS_PARENT_PREFIX(subop)) { | ||
837 | 854 | ||
838 | /* NULL target (zero). Convert to a NULL namepath */ | 855 | /* NULL target (zero). Convert to a NULL namepath */ |
839 | 856 | ||
@@ -848,6 +865,12 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state, | |||
848 | acpi_ps_get_next_namepath(walk_state, parser_state, | 865 | acpi_ps_get_next_namepath(walk_state, parser_state, |
849 | arg, | 866 | arg, |
850 | ACPI_POSSIBLE_METHOD_CALL); | 867 | ACPI_POSSIBLE_METHOD_CALL); |
868 | |||
869 | if (arg->common.aml_opcode == AML_INT_METHODCALL_OP) { | ||
870 | acpi_ps_free_op(arg); | ||
871 | arg = NULL; | ||
872 | walk_state->arg_count = 1; | ||
873 | } | ||
851 | } else { | 874 | } else { |
852 | /* Single complex argument, nothing returned */ | 875 | /* Single complex argument, nothing returned */ |
853 | 876 | ||