acpi: device: avoid empty property list in acpi_dp_write
commit08258881ed56e008366c9c242cd0e6ba14123de6
authorMatt Delco <delco@chromium.org>
Wed, 30 Jan 2019 19:16:08 +0000 (30 11:16 -0800)
committerPatrick Georgi <pgeorgi@google.com>
Tue, 5 Feb 2019 13:40:31 +0000 (5 13:40 +0000)
tree7ee71a1850da6725a99dcbec0536b629d5515816
parent4bbe8df1dc319a4dece21b0625926693d3a773a7
acpi: device: avoid empty property list in acpi_dp_write

If an acpi_dp table has children but no properties then acpi_dp_write()
will write out a properties UUID and package that contains no properties.
The existing function will avoid writing out a UUID and empty package
when no children exist, but it seems to assume that properties will
always be used.  With this change properties are handled in a manner
akin to children so that a UUID and package are only written if
properties exist.

BUG=none
BRANCH=none
TEST=Confirmed that prior to this change a UUID and empty package was
present for a device that had children but no properties.  Verified that
after this change the UUID and empty package are no longer present but
the child UUID and package are still present.

Change-Id: I6f5597713a1e91ca26b409f36b3ff9eb90a010af
Signed-off-by: Matt Delco <delco@chromium.org>
Reviewed-on: https://review.coreboot.org/c/31161
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
src/arch/x86/acpi_device.c