aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi
diff options
context:
space:
mode:
authorHeikki Krogerus2020-06-09 16:22:39 +0300
committerRafael J. Wysocki2020-06-22 17:08:58 +0200
commitcbdd865a94aee4f21e7be330e622d9a8b5ad2db8 (patch)
tree6cf2b546f8cf5333fb2be2dba5a06202d2f6065b /drivers/acpi
parent48778464bb7d346b47157d21ffde2af6b2d39110 (diff)
ACPI: property: use cached name in acpi_fwnode_get_named_child_node()
There is no need to re-evaluate the object name. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/property.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
index e601c4511a8b..6941062272e0 100644
--- a/drivers/acpi/property.c
+++ b/drivers/acpi/property.c
@@ -606,13 +606,7 @@ static struct fwnode_handle *
acpi_fwnode_get_named_child_node(const struct fwnode_handle *fwnode,
const char *childname)
{
- char name[ACPI_PATH_SEGMENT_LENGTH];
struct fwnode_handle *child;
- struct acpi_buffer path;
- acpi_status status;
-
- path.length = sizeof(name);
- path.pointer = name;
fwnode_for_each_child_node(fwnode, child) {
if (is_acpi_data_node(child)) {
@@ -621,12 +615,8 @@ acpi_fwnode_get_named_child_node(const struct fwnode_handle *fwnode,
continue;
}
- status = acpi_get_name(ACPI_HANDLE_FWNODE(child),
- ACPI_SINGLE_NAME, &path);
- if (ACPI_FAILURE(status))
- break;
-
- if (!strncmp(name, childname, ACPI_NAMESEG_SIZE))
+ if (!strncmp(acpi_device_bid(to_acpi_device_node(child)),
+ childname, ACPI_NAMESEG_SIZE))
return child;
}