mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
UPSTREAM: x86/acpi_device: Fix writing of array property
Only acpi_dp of type DP_TYPE_TABLE is allowed to be an array. This DP_TYPE_TABLE does not have a value which is written. Thus, acpi_dp_write_array needs to start counting from the next element type in the array. Fix this by updating the initialization in for loop for writing array elements. BUG=chrome-os-partner:55988 BRANCH=None TEST=Verified that the correct number of elements are passed for add_gpio in maxim sdmode-gpio. Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://review.coreboot.org/16871 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Change-Id: I8e1e540d66086971de2edf0bb83494d3b1dbd176 Reviewed-on: https://chromium-review.googlesource.com/396151 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
910414e735
commit
41f3079168
1 changed files with 6 additions and 1 deletions
|
@ -530,7 +530,12 @@ static void acpi_dp_write_array(const struct acpi_dp *array)
|
|||
/* Package element count determined as it is populated */
|
||||
pkg_count = acpigen_write_package(0);
|
||||
|
||||
for (dp = array; dp; dp = dp->next) {
|
||||
/*
|
||||
* Only acpi_dp of type DP_TYPE_TABLE is allowed to be an array.
|
||||
* DP_TYPE_TABLE does not have a value to be written. Thus, start
|
||||
* the loop from next type in the array.
|
||||
*/
|
||||
for (dp = array->next; dp; dp = dp->next) {
|
||||
acpi_dp_write_value(dp);
|
||||
(*pkg_count)++;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue