Duncan Laurie (dlaurie@chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15521
-gerrit
commit 1f540a06d8184636e4ccb0c847e6db91b79855f0 Author: Duncan Laurie dlaurie@chromium.org Date: Thu Jun 30 14:37:37 2016 -0700
acpi_device: Have acpi_device_scope() use a separate buffer
Have the different acpi_device_ path functions use a different static buffer so they can be called interchangeably.
Change-Id: I270a80f66880861d5847bd586a16a73f8f1e2511 Signed-off-by: Duncan Laurie dlaurie@chromium.org --- src/arch/x86/acpi_device.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/arch/x86/acpi_device.c b/src/arch/x86/acpi_device.c index 69d44f3..1f0ab37 100644 --- a/src/arch/x86/acpi_device.c +++ b/src/arch/x86/acpi_device.c @@ -121,10 +121,15 @@ const char *acpi_device_path(struct device *dev) /* Return the path of the parent device as the ACPI Scope for this device */ const char *acpi_device_scope(struct device *dev) { + static char buf[DEVICE_PATH_MAX] = {}; + if (!dev || !dev->bus || !dev->bus->dev) return NULL;
- return acpi_device_path(dev->bus->dev); + if (acpi_device_path_fill(dev->bus->dev, buf, sizeof(buf), 0) <= 0) + return NULL; + + return buf; }
/* Concatentate the device path and provided name suffix */