mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
UPSTREAM: 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. BUG=None BRANCH=None TEST=None Change-Id: I270a80f66880861d5847bd586a16a73f8f1e2511 Original-Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Original-Reviewed-on: https://review.coreboot.org/15521 Original-Tested-by: build bot (Jenkins) Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/358588 Reviewed-by: Martin Roth <martinroth@chromium.org>
This commit is contained in:
parent
4a3f465f60
commit
741c23e45d
1 changed files with 6 additions and 1 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Reference in a new issue