software node: Use kobject name when finding child nodes by name
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>
Fri, 31 May 2019 14:15:35 +0000 (17:15 +0300)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 3 Jun 2019 08:55:38 +0000 (10:55 +0200)
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>
drivers/base/swnode.c

index ef1a48f..2d925fc 100644 (file)
@@ -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;
                }