summaryrefslogtreecommitdiff
path: root/drivers/core/ofnode.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/core/ofnode.c')
-rw-r--r--drivers/core/ofnode.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index 0cfb0fbabb..a7e1927723 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -777,3 +777,17 @@ ofnode ofnode_by_compatible(ofnode from, const char *compat)
gd->fdt_blob, ofnode_to_offset(from), compat));
}
}
+
+ofnode ofnode_by_prop_value(ofnode from, const char *propname,
+ const void *propval, int proplen)
+{
+ if (of_live_active()) {
+ return np_to_ofnode(of_find_node_by_prop_value(
+ (struct device_node *)ofnode_to_np(from), propname,
+ propval, proplen));
+ } else {
+ return offset_to_ofnode(fdt_node_offset_by_prop_value(
+ gd->fdt_blob, ofnode_to_offset(from),
+ propname, propval, proplen));
+ }
+}