summaryrefslogtreecommitdiffstats
path: root/drivers/of/resolver.c
diff options
context:
space:
mode:
authorFrank Rowand <frank.rowand@am.sony.com>2016-10-29 08:26:31 +0200
committerRob Herring <robh@kernel.org>2016-11-15 16:17:17 +0100
commit4458db4c9b7363a60d9ad07275fb2eea4ecf3b52 (patch)
tree0b15a593cf04da5e9580099e1780a032f75baed5 /drivers/of/resolver.c
parentof: Add back an error message, restructured (diff)
downloadlinux-4458db4c9b7363a60d9ad07275fb2eea4ecf3b52.tar.xz
linux-4458db4c9b7363a60d9ad07275fb2eea4ecf3b52.zip
of: Move setting of pointer to beside test for non-null
Value of pointer was calculated in an earlier block than where it was used. Move it down into the block where it is used, immediately before where is is checked to be valid. Signed-off-by: Frank Rowand <frank.rowand@am.sony.com> Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/of/resolver.c')
-rw-r--r--drivers/of/resolver.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/of/resolver.c b/drivers/of/resolver.c
index eb78010c21a3..53353cc8f2bb 100644
--- a/drivers/of/resolver.c
+++ b/drivers/of/resolver.c
@@ -320,8 +320,6 @@ int of_resolve_phandles(struct device_node *overlay)
overlay_symbols = NULL;
overlay_fixups = NULL;
- tree_symbols = of_find_node_by_path("/__symbols__");
-
for_each_child_of_node(overlay, child) {
if (!of_node_cmp(child->name, "__symbols__"))
overlay_symbols = child;
@@ -334,6 +332,7 @@ int of_resolve_phandles(struct device_node *overlay)
goto out;
}
+ tree_symbols = of_find_node_by_path("/__symbols__");
if (!tree_symbols) {
pr_err("no symbols in root of device tree.\n");
err = -EINVAL;