return done ? 0 : -ENODEV;
}
-static int __of_link_to_suppliers(struct device *dev,
- struct device_node *con_np)
-{
- struct device_node *child;
- struct property *p;
- bool done = true;
-
- for_each_property_of_node(con_np, p)
- if (of_link_property(dev, con_np, p->name))
- done = false;
-
- for_each_child_of_node(con_np, child)
- if (__of_link_to_suppliers(dev, child))
- done = false;
-
- return done ? 0 : -ENODEV;
-}
-
static bool of_devlink;
core_param(of_devlink, of_devlink, bool, 0);
static int of_link_to_suppliers(struct device *dev)
{
+ struct property *p;
+ bool done = true;
+
if (!of_devlink)
return 0;
if (unlikely(!dev->of_node))
return 0;
- return __of_link_to_suppliers(dev, dev->of_node);
+ for_each_property_of_node(dev->of_node, p)
+ if (of_link_property(dev, dev->of_node, p->name))
+ done = false;
+
+ return done ? 0 : -ENODEV;
}
#ifndef CONFIG_PPC