forked from Minki/linux
ACPICA: Update two error messages to emit control method name
ACPICA commit 73f7fab1376d5dbfda24cf51c1bb04df0d31b48e Intention is to improve debugging by clarifying which method has caused the error, in acpi_evaluate_object_typed. Link: https://github.com/acpica/acpica/commit/73f7fab1 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>
This commit is contained in:
parent
1d6e9cfa5a
commit
2d2a954375
@ -85,6 +85,8 @@ acpi_evaluate_object_typed(acpi_handle handle,
|
|||||||
{
|
{
|
||||||
acpi_status status;
|
acpi_status status;
|
||||||
u8 free_buffer_on_error = FALSE;
|
u8 free_buffer_on_error = FALSE;
|
||||||
|
acpi_handle target_handle;
|
||||||
|
char *full_pathname;
|
||||||
|
|
||||||
ACPI_FUNCTION_TRACE(acpi_evaluate_object_typed);
|
ACPI_FUNCTION_TRACE(acpi_evaluate_object_typed);
|
||||||
|
|
||||||
@ -98,38 +100,51 @@ acpi_evaluate_object_typed(acpi_handle handle,
|
|||||||
free_buffer_on_error = TRUE;
|
free_buffer_on_error = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Evaluate the object */
|
status = acpi_get_handle(handle, pathname, &target_handle);
|
||||||
|
|
||||||
status = acpi_evaluate_object(handle, pathname,
|
|
||||||
external_params, return_buffer);
|
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
return_ACPI_STATUS(status);
|
return_ACPI_STATUS(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Type ANY means "don't care" */
|
full_pathname = acpi_ns_get_external_pathname(target_handle);
|
||||||
|
if (!full_pathname) {
|
||||||
|
return_ACPI_STATUS(AE_NO_MEMORY);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Evaluate the object */
|
||||||
|
|
||||||
|
status = acpi_evaluate_object(target_handle, NULL, external_params,
|
||||||
|
return_buffer);
|
||||||
|
if (ACPI_FAILURE(status)) {
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Type ANY means "don't care about return value type" */
|
||||||
|
|
||||||
if (return_type == ACPI_TYPE_ANY) {
|
if (return_type == ACPI_TYPE_ANY) {
|
||||||
return_ACPI_STATUS(AE_OK);
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (return_buffer->length == 0) {
|
if (return_buffer->length == 0) {
|
||||||
|
|
||||||
/* Error because caller specifically asked for a return value */
|
/* Error because caller specifically asked for a return value */
|
||||||
|
|
||||||
ACPI_ERROR((AE_INFO, "No return value"));
|
ACPI_ERROR((AE_INFO, "%s did not return any object",
|
||||||
return_ACPI_STATUS(AE_NULL_OBJECT);
|
full_pathname));
|
||||||
|
status = AE_NULL_OBJECT;
|
||||||
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Examine the object type returned from evaluate_object */
|
/* Examine the object type returned from evaluate_object */
|
||||||
|
|
||||||
if (((union acpi_object *)return_buffer->pointer)->type == return_type) {
|
if (((union acpi_object *)return_buffer->pointer)->type == return_type) {
|
||||||
return_ACPI_STATUS(AE_OK);
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return object type does not match requested type */
|
/* Return object type does not match requested type */
|
||||||
|
|
||||||
ACPI_ERROR((AE_INFO,
|
ACPI_ERROR((AE_INFO,
|
||||||
"Incorrect return type [%s] requested [%s]",
|
"Incorrect return type from %s - received [%s], requested [%s]",
|
||||||
|
full_pathname,
|
||||||
acpi_ut_get_type_name(((union acpi_object *)return_buffer->
|
acpi_ut_get_type_name(((union acpi_object *)return_buffer->
|
||||||
pointer)->type),
|
pointer)->type),
|
||||||
acpi_ut_get_type_name(return_type)));
|
acpi_ut_get_type_name(return_type)));
|
||||||
@ -147,7 +162,11 @@ acpi_evaluate_object_typed(acpi_handle handle,
|
|||||||
}
|
}
|
||||||
|
|
||||||
return_buffer->length = 0;
|
return_buffer->length = 0;
|
||||||
return_ACPI_STATUS(AE_TYPE);
|
status = AE_TYPE;
|
||||||
|
|
||||||
|
exit:
|
||||||
|
ACPI_FREE(full_pathname);
|
||||||
|
return_ACPI_STATUS(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
ACPI_EXPORT_SYMBOL(acpi_evaluate_object_typed)
|
ACPI_EXPORT_SYMBOL(acpi_evaluate_object_typed)
|
||||||
|
Loading…
Reference in New Issue
Block a user