mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 16:37:50 +00:00
software node: Use kobject name when finding child nodes by name
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 <heikki.krogerus@linux.intel.com> Tested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
80488a6b1d
commit
c959d0c231
1 changed files with 1 additions and 5 deletions
|
@ -546,17 +546,13 @@ software_node_get_named_child_node(const struct fwnode_handle *fwnode,
|
||||||
const char *childname)
|
const char *childname)
|
||||||
{
|
{
|
||||||
struct swnode *swnode = to_swnode(fwnode);
|
struct swnode *swnode = to_swnode(fwnode);
|
||||||
const struct property_entry *prop;
|
|
||||||
struct swnode *child;
|
struct swnode *child;
|
||||||
|
|
||||||
if (!swnode || list_empty(&swnode->children))
|
if (!swnode || list_empty(&swnode->children))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
list_for_each_entry(child, &swnode->children, entry) {
|
list_for_each_entry(child, &swnode->children, entry) {
|
||||||
prop = property_entry_get(child->node->properties, "name");
|
if (!strcmp(childname, kobject_name(&child->kobj))) {
|
||||||
if (!prop)
|
|
||||||
continue;
|
|
||||||
if (!strcmp(childname, prop->value.str)) {
|
|
||||||
kobject_get(&child->kobj);
|
kobject_get(&child->kobj);
|
||||||
return &child->fwnode;
|
return &child->fwnode;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue