Skip to content

Commit

Permalink
ACPI: add ACPI_TYPE_LOCAL_REFERENCE support to acpi_extract_package()
Browse files Browse the repository at this point in the history
Add ACPI_TYPE_LOCAL_REFERENCE support to acpi_extract_package(),
so that we can use this helper for more cases like _ART/_TRT.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
  • Loading branch information
Zhang Rui committed Oct 10, 2014
1 parent 083bf66 commit e3ec483
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion drivers/acpi/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,21 @@ acpi_extract_package(union acpi_object *package,
break;
}
break;
case ACPI_TYPE_LOCAL_REFERENCE:
switch (format_string[i]) {
case 'R':
size_required += sizeof(void *);
tail_offset += sizeof(void *);
break;
default:
printk(KERN_WARNING PREFIX "Invalid package element"
" [%d] got reference,"
" expecting [%c]\n",
i, format_string[i]);
return AE_BAD_DATA;
break;
}
break;

case ACPI_TYPE_PACKAGE:
default:
Expand Down Expand Up @@ -247,7 +262,18 @@ acpi_extract_package(union acpi_object *package,
break;
}
break;

case ACPI_TYPE_LOCAL_REFERENCE:
switch (format_string[i]) {
case 'R':
*(void **)head =
(void *)element->reference.handle;
head += sizeof(void *);
break;
default:
/* Should never get here */
break;
}
break;
case ACPI_TYPE_PACKAGE:
/* TBD: handle nested packages... */
default:
Expand Down

0 comments on commit e3ec483

Please sign in to comment.