aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/rscreate.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/acpica/rscreate.c')
-rw-r--r--drivers/acpi/acpica/rscreate.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/drivers/acpi/acpica/rscreate.c b/drivers/acpi/acpica/rscreate.c
index 65f3e1c5b598..3a2ace93e62c 100644
--- a/drivers/acpi/acpica/rscreate.c
+++ b/drivers/acpi/acpica/rscreate.c
@@ -418,22 +418,21 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
418 * 418 *
419 * FUNCTION: acpi_rs_create_aml_resources 419 * FUNCTION: acpi_rs_create_aml_resources
420 * 420 *
421 * PARAMETERS: linked_list_buffer - Pointer to the resource linked list 421 * PARAMETERS: resource_list - Pointer to the resource list buffer
422 * output_buffer - Pointer to the user's buffer 422 * output_buffer - Where the AML buffer is returned
423 * 423 *
424 * RETURN: Status AE_OK if okay, else a valid acpi_status code. 424 * RETURN: Status AE_OK if okay, else a valid acpi_status code.
425 * If the output_buffer is too small, the error will be 425 * If the output_buffer is too small, the error will be
426 * AE_BUFFER_OVERFLOW and output_buffer->Length will point 426 * AE_BUFFER_OVERFLOW and output_buffer->Length will point
427 * to the size buffer needed. 427 * to the size buffer needed.
428 * 428 *
429 * DESCRIPTION: Takes the linked list of device resources and 429 * DESCRIPTION: Converts a list of device resources to an AML bytestream
430 * creates a bytestream to be used as input for the 430 * to be used as input for the _SRS control method.
431 * _SRS control method.
432 * 431 *
433 ******************************************************************************/ 432 ******************************************************************************/
434 433
435acpi_status 434acpi_status
436acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer, 435acpi_rs_create_aml_resources(struct acpi_buffer *resource_list,
437 struct acpi_buffer *output_buffer) 436 struct acpi_buffer *output_buffer)
438{ 437{
439 acpi_status status; 438 acpi_status status;
@@ -441,16 +440,16 @@ acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer,
441 440
442 ACPI_FUNCTION_TRACE(rs_create_aml_resources); 441 ACPI_FUNCTION_TRACE(rs_create_aml_resources);
443 442
444 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "LinkedListBuffer = %p\n", 443 /* Params already validated, no need to re-validate here */
445 linked_list_buffer));
446 444
447 /* 445 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "ResourceList Buffer = %p\n",
448 * Params already validated, so we don't re-validate here 446 resource_list->pointer));
449 * 447
450 * Pass the linked_list_buffer into a module that calculates 448 /* Get the buffer size needed for the AML byte stream */
451 * the buffer size needed for the byte stream. 449
452 */ 450 status = acpi_rs_get_aml_length(resource_list->pointer,
453 status = acpi_rs_get_aml_length(linked_list_buffer, &aml_size_needed); 451 resource_list->length,
452 &aml_size_needed);
454 453
455 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "AmlSizeNeeded=%X, %s\n", 454 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "AmlSizeNeeded=%X, %s\n",
456 (u32)aml_size_needed, acpi_format_exception(status))); 455 (u32)aml_size_needed, acpi_format_exception(status)));
@@ -467,10 +466,9 @@ acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer,
467 466
468 /* Do the conversion */ 467 /* Do the conversion */
469 468
470 status = 469 status = acpi_rs_convert_resources_to_aml(resource_list->pointer,
471 acpi_rs_convert_resources_to_aml(linked_list_buffer, 470 aml_size_needed,
472 aml_size_needed, 471 output_buffer->pointer);
473 output_buffer->pointer);
474 if (ACPI_FAILURE(status)) { 472 if (ACPI_FAILURE(status)) {
475 return_ACPI_STATUS(status); 473 return_ACPI_STATUS(status);
476 } 474 }