From b26b7ef0f04d823e70f57684c8ee01277ade572a Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Mon, 25 Feb 2013 10:04:59 +0100 Subject: 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 --- commands/of_property.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'commands/of_property.c') diff --git a/commands/of_property.c b/commands/of_property.c index 42b6f1123f..585522c3d4 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; -- cgit v1.2.3