diff options
author | Duncan Laurie <dlaurie@chromium.org> | 2016-06-30 14:37:37 -0700 |
---|---|---|
committer | Duncan Laurie <dlaurie@chromium.org> | 2016-07-02 01:20:18 +0200 |
commit | d02685b053d4597c498afd9baf4f2b6dc82e00d5 (patch) | |
tree | b00fe5c695cd80c420d3d88e1cba7bcbb0a7fb01 /src | |
parent | abdbed9cf3a1104bcd3a35fd5f3de3988d45fee5 (diff) |
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>
Reviewed-on: https://review.coreboot.org/15521
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/arch/x86/acpi_device.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/arch/x86/acpi_device.c b/src/arch/x86/acpi_device.c index 940d87156d..f8f6a6dbe9 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 */ |