diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-07-02 07:08:33 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-07-02 07:08:46 +0200 |
commit | 8afe2cb4d4af5b472adeac9132200dc8c9100821 (patch) | |
tree | b6164ed60137b82e6e820a329999f4f0f515bd84 /commands | |
parent | 12657cb99e1ca670da6a7cace3b238a42003e629 (diff) | |
parent | fff76d57d2670a8f15c875355fb840665ebf8a3e (diff) | |
download | barebox-8afe2cb4d4af5b472adeac9132200dc8c9100821.tar.gz barebox-8afe2cb4d4af5b472adeac9132200dc8c9100821.tar.xz |
Merge branch 'for-next-manual/oftree-linux-sync'
Diffstat (limited to 'commands')
-rw-r--r-- | commands/of_node.c | 2 | ||||
-rw-r--r-- | commands/of_property.c | 12 | ||||
-rw-r--r-- | commands/oftree.c | 11 |
3 files changed, 5 insertions, 20 deletions
diff --git a/commands/of_node.c b/commands/of_node.c index 0249d9725b..e60ef66d38 100644 --- a/commands/of_node.c +++ b/commands/of_node.c @@ -81,7 +81,7 @@ static int do_of_node(int argc, char *argv[]) if (!path) return COMMAND_ERROR_USAGE; - 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; diff --git a/commands/of_property.c b/commands/of_property.c index 44bb38801e..8ffe30b25f 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; @@ -212,7 +206,7 @@ static int do_of_property(int argc, char *argv[]) if (optind + 1 < argc) { propname = argv[optind + 1]; - pp = of_find_property(node, propname); + pp = of_find_property(node, propname, NULL); if (!set && !pp) { printf("Cannot find property %s\n", propname); return -ENOENT; diff --git a/commands/oftree.c b/commands/oftree.c index 468235a043..914951735b 100644 --- a/commands/oftree.c +++ b/commands/oftree.c @@ -164,16 +164,7 @@ static int do_oftree(int argc, char *argv[]) of_print_nodes(root, 0); of_free(root); } else { - struct device_node *root, *n; - - root = of_get_root_node(); - if (!root) { - ret = -ENOENT; - goto out; - } - - n = of_find_node_by_path(root, node); - + struct device_node *n = of_find_node_by_path(node); if (!n) { ret = -ENOENT; goto out; |