Skip to content

Commit

Permalink
software node: Use kobject name when finding child nodes by name
Browse files Browse the repository at this point in the history
Using the kobject name of the node instead of a device
property "name" in software_node_get_named_child_node().

Signed-off-by: Heikki Krogerus <[email protected]>
Tested-by: Hans de Goede <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
Heikki Krogerus authored and rafaeljw committed Jun 3, 2019
1 parent 80488a6 commit c959d0c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drivers/base/swnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,17 +546,13 @@ software_node_get_named_child_node(const struct fwnode_handle *fwnode,
const char *childname)
{
struct swnode *swnode = to_swnode(fwnode);
const struct property_entry *prop;
struct swnode *child;

if (!swnode || list_empty(&swnode->children))
return NULL;

list_for_each_entry(child, &swnode->children, entry) {
prop = property_entry_get(child->node->properties, "name");
if (!prop)
continue;
if (!strcmp(childname, prop->value.str)) {
if (!strcmp(childname, kobject_name(&child->kobj))) {
kobject_get(&child->kobj);
return &child->fwnode;
}
Expand Down

0 comments on commit c959d0c

Please sign in to comment.