summaryrefslogtreecommitdiffstats
path: root/commands/of_property.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-02-25 10:04:59 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-03-06 11:41:28 +0100
commitb26b7ef0f04d823e70f57684c8ee01277ade572a (patch)
tree135746b39e2ba4b6b68f7e4b8ad6829dd71a8968 /commands/of_property.c
parent8a185a4ff2283c670ffc8724c1b7bdbf8d458cbe (diff)
downloadbarebox-b26b7ef0f04d823e70f57684c8ee01277ade572a.tar.gz
of: Add root node argument to of_find_node_by_path
This makes of_find_node_by_path usable with multiple trees. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/of_property.c')
-rw-r--r--commands/of_property.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/commands/of_property.c b/commands/of_property.c
index 42b6f11..585522c 100644
--- a/commands/of_property.c
+++ b/commands/of_property.c
@@ -176,7 +176,7 @@ static int do_of_property(int argc, char *argv[])
int set = 0;
int ret;
char *path = NULL, *propname = NULL;
- struct device_node *node = NULL;
+ struct device_node *root, *node = NULL;
struct property *pp = NULL;
while ((opt = getopt(argc, argv, "ds")) > 0) {
@@ -192,9 +192,15 @@ static int do_of_property(int argc, char *argv[])
}
}
+ root = of_get_root_node();
+ if (!root) {
+ printf("root node not set\n");
+ return -ENOENT;
+ }
+
if (optind < argc) {
path = argv[optind];
- node = of_find_node_by_path(path);
+ node = of_find_node_by_path(root, path);
if (!node) {
printf("Cannot find nodepath %s\n", path);
return -ENOENT;