|
@@ -614,6 +614,27 @@ int of_modalias_node(struct device_node *node, char *modalias, int len)
|
|
}
|
|
}
|
|
EXPORT_SYMBOL_GPL(of_modalias_node);
|
|
EXPORT_SYMBOL_GPL(of_modalias_node);
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * of_find_node_by_phandle - Find a node given a phandle
|
|
|
|
+ * @handle: phandle of the node to find
|
|
|
|
+ *
|
|
|
|
+ * Returns a node pointer with refcount incremented, use
|
|
|
|
+ * of_node_put() on it when done.
|
|
|
|
+ */
|
|
|
|
+struct device_node *of_find_node_by_phandle(phandle handle)
|
|
|
|
+{
|
|
|
|
+ struct device_node *np;
|
|
|
|
+
|
|
|
|
+ read_lock(&devtree_lock);
|
|
|
|
+ for (np = allnodes; np; np = np->allnext)
|
|
|
|
+ if (np->phandle == handle)
|
|
|
|
+ break;
|
|
|
|
+ of_node_get(np);
|
|
|
|
+ read_unlock(&devtree_lock);
|
|
|
|
+ return np;
|
|
|
|
+}
|
|
|
|
+EXPORT_SYMBOL(of_find_node_by_phandle);
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* of_parse_phandle - Resolve a phandle property to a device_node pointer
|
|
* of_parse_phandle - Resolve a phandle property to a device_node pointer
|
|
* @np: Pointer to device node holding phandle property
|
|
* @np: Pointer to device node holding phandle property
|