summaryrefslogtreecommitdiffstats
path: root/include/of.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-01-26 13:44:34 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2018-02-06 09:39:05 +0100
commitbc95e7a96330aa11ff1a094d035a434fd8db6b23 (patch)
tree5b7bef21d92f6c85bf71af44668ee86514e1b02e /include/of.h
parent6c2e0f6c748eeaa231e1f23439c3a68bd401ea37 (diff)
downloadbarebox-bc95e7a96330aa11ff1a094d035a434fd8db6b23.tar.gz
barebox-bc95e7a96330aa11ff1a094d035a434fd8db6b23.tar.xz
of: Add function to find the same node in another tree
For our device tree fixups we have to find a node corresponding to another node in another device tree. We used to use the full name to match the nodes, but this falls apart when nodes get renamed or for example a new bus hierarchy is introduced. To make this more robust we create reproducible names from device nodes which mostly depend on the address in MMIO space, the reg property and as a last resort the name of the device node. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/of.h')
-rw-r--r--include/of.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/of.h b/include/of.h
index 1b9719d603..4564f48514 100644
--- a/include/of.h
+++ b/include/of.h
@@ -164,7 +164,10 @@ extern int of_get_child_count(const struct device_node *parent);
extern int of_get_available_child_count(const struct device_node *parent);
extern struct device_node *of_get_child_by_name(const struct device_node *node,
const char *name);
-
+extern char *of_get_reproducible_name(struct device_node *node);
+extern struct device_node *of_find_node_by_reproducible_name(struct device_node
+ *from,
+ const char *name);
extern int of_property_read_u32_index(const struct device_node *np,
const char *propname,
u32 index, u32 *out_value);