return np;
}
-struct device_node *of_find_node_by_phandle(phandle handle)
+struct device_node *of_find_node_by_phandle(struct device_node *root,
+ phandle handle)
{
struct device_node *np;
if (!handle)
return NULL;
- for_each_of_allnodes(np)
+ for_each_of_allnodes_from(root, np)
if (np->phandle == handle)
break;
(void)of_node_get(np);
* below.
*/
if (cells_name || cur_index == index) {
- node = of_find_node_by_phandle(phandle);
+ node = of_find_node_by_phandle(NULL, phandle);
if (!node) {
debug("%s: could not find phandle\n",
np->full_name);
ofnode node;
if (of_live_active())
- node = np_to_ofnode(of_find_node_by_phandle(phandle));
+ node = np_to_ofnode(of_find_node_by_phandle(NULL, phandle));
else
node.of_offset = fdt_node_offset_by_phandle(gd->fdt_blob,
phandle);
/**
* of_find_node_by_phandle() - Find a node given a phandle
*
+ * @root: root node to start from (NULL for default device tree)
* @handle: phandle of the node to find
*
* Return: node pointer, or NULL if not found
*/
-struct device_node *of_find_node_by_phandle(phandle handle);
+struct device_node *of_find_node_by_phandle(struct device_node *root,
+ phandle handle);
/**
* of_read_u8() - Find and read a 8-bit integer from a property
/**
* ofnode_get_by_phandle() - get ofnode from phandle
*
+ * This uses the default (control) device tree
+ *
* @phandle: phandle to look up
* Return: ofnode reference to the phandle
*/