diff options
Diffstat (limited to 'drivers/core/acpi.c')
-rw-r--r-- | drivers/core/acpi.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/core/acpi.c b/drivers/core/acpi.c index b566f4f186..ae69258562 100644 --- a/drivers/core/acpi.c +++ b/drivers/core/acpi.c @@ -82,6 +82,25 @@ int acpi_get_name(const struct udevice *dev, char *out_name) return 0; } +int acpi_get_path(const struct udevice *dev, char *out_path, int maxlen) +{ + const char *path; + int ret; + + path = dev_read_string(dev, "acpi,path"); + if (path) { + if (strlen(path) >= maxlen) + return -E2BIG; + strcpy(out_path, path); + return 0; + } + ret = acpi_device_path(dev, out_path, maxlen); + if (ret) + return log_msg_ret("dev", ret); + + return 0; +} + /** * acpi_add_item() - Add a new item to the list of data collected * |