summaryrefslogtreecommitdiffstats
path: root/commands/of_property.c
diff options
context:
space:
mode:
authorSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>2013-06-13 18:06:44 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-06-20 21:20:50 +0200
commit0b79c3bb641857f5045a42f55f0b90d160706425 (patch)
tree10ce0b10a34032f30d73337ea48b3f7cdbcffe34 /commands/of_property.c
parent905f3ee7fb79af91ed42275c995ca0cd04a2a3d6 (diff)
downloadbarebox-0b79c3bb641857f5045a42f55f0b90d160706425.tar.gz
OF: base: sync of_find_node_by_path with linux OF API
Barebox of_find_node_by_path requires a node to be passed as start node to start searching. Linux OF API does not pass this node and no current user of it in barebox is passing anything else than the root node. Therefore, we rename current function to of_find_node_by_path_from and introduce a Linux OF API compatible of_find_node_by_path that always passes the current root_node. Also, all current users of that function are updated to reflect the API change. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> 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, 2 insertions, 8 deletions
diff --git a/commands/of_property.c b/commands/of_property.c
index d1a9a17..8ffe30b 100644
--- a/commands/of_property.c
+++ b/commands/of_property.c
@@ -175,7 +175,7 @@ static int do_of_property(int argc, char *argv[])
int set = 0;
int ret;
char *path = NULL, *propname = NULL;
- struct device_node *root, *node = NULL;
+ struct device_node *node = NULL;
struct property *pp = NULL;
while ((opt = getopt(argc, argv, "ds")) > 0) {
@@ -194,15 +194,9 @@ static int do_of_property(int argc, char *argv[])
if (optind == argc)
return COMMAND_ERROR_USAGE;
- 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(root, path);
+ node = of_find_node_by_path(path);
if (!node) {
printf("Cannot find nodepath %s\n", path);
return -ENOENT;