Skip to content

Commit cbdd865

Browse files
Heikki Krogerusrafaeljw
authored andcommitted
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 <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 4877846 commit cbdd865

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

drivers/acpi/property.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -606,13 +606,7 @@ static struct fwnode_handle *
606606
acpi_fwnode_get_named_child_node(const struct fwnode_handle *fwnode,
607607
const char *childname)
608608
{
609-
char name[ACPI_PATH_SEGMENT_LENGTH];
610609
struct fwnode_handle *child;
611-
struct acpi_buffer path;
612-
acpi_status status;
613-
614-
path.length = sizeof(name);
615-
path.pointer = name;
616610

617611
fwnode_for_each_child_node(fwnode, child) {
618612
if (is_acpi_data_node(child)) {
@@ -621,12 +615,8 @@ acpi_fwnode_get_named_child_node(const struct fwnode_handle *fwnode,
621615
continue;
622616
}
623617

624-
status = acpi_get_name(ACPI_HANDLE_FWNODE(child),
625-
ACPI_SINGLE_NAME, &path);
626-
if (ACPI_FAILURE(status))
627-
break;
628-
629-
if (!strncmp(name, childname, ACPI_NAMESEG_SIZE))
618+
if (!strncmp(acpi_device_bid(to_acpi_device_node(child)),
619+
childname, ACPI_NAMESEG_SIZE))
630620
return child;
631621
}
632622

0 commit comments

Comments
 (0)