Commit 32bed310 authored by Moritz Fischer's avatar Moritz Fischer Committed by Rob Herring

of: Fix issue where code would fall through to error case.

No longer fall through into the error case that prints out
an error if no error (err = 0) occurred.

Fixes d9181b20(of: Add back an error message, restructured)
Signed-off-by: default avatarMoritz Fischer <mdf@kernel.org>
Reviewed-by: default avatarFrank Rowand <frank.rowand@am.sony.com>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
parent 4aa66344
...@@ -298,12 +298,12 @@ int of_resolve_phandles(struct device_node *overlay) ...@@ -298,12 +298,12 @@ int of_resolve_phandles(struct device_node *overlay)
if (!overlay) { if (!overlay) {
pr_err("null overlay\n"); pr_err("null overlay\n");
err = -EINVAL; err = -EINVAL;
goto err_out; goto out;
} }
if (!of_node_check_flag(overlay, OF_DETACHED)) { if (!of_node_check_flag(overlay, OF_DETACHED)) {
pr_err("overlay not detached\n"); pr_err("overlay not detached\n");
err = -EINVAL; err = -EINVAL;
goto err_out; goto out;
} }
phandle_delta = live_tree_max_phandle() + 1; phandle_delta = live_tree_max_phandle() + 1;
...@@ -315,7 +315,7 @@ int of_resolve_phandles(struct device_node *overlay) ...@@ -315,7 +315,7 @@ int of_resolve_phandles(struct device_node *overlay)
err = adjust_local_phandle_references(local_fixups, overlay, phandle_delta); err = adjust_local_phandle_references(local_fixups, overlay, phandle_delta);
if (err) if (err)
goto err_out; goto out;
overlay_fixups = NULL; overlay_fixups = NULL;
...@@ -333,7 +333,7 @@ int of_resolve_phandles(struct device_node *overlay) ...@@ -333,7 +333,7 @@ int of_resolve_phandles(struct device_node *overlay)
if (!tree_symbols) { if (!tree_symbols) {
pr_err("no symbols in root of device tree.\n"); pr_err("no symbols in root of device tree.\n");
err = -EINVAL; err = -EINVAL;
goto err_out; goto out;
} }
for_each_property_of_node(overlay_fixups, prop) { for_each_property_of_node(overlay_fixups, prop) {
...@@ -345,12 +345,12 @@ int of_resolve_phandles(struct device_node *overlay) ...@@ -345,12 +345,12 @@ int of_resolve_phandles(struct device_node *overlay)
err = of_property_read_string(tree_symbols, err = of_property_read_string(tree_symbols,
prop->name, &refpath); prop->name, &refpath);
if (err) if (err)
goto err_out; goto out;
refnode = of_find_node_by_path(refpath); refnode = of_find_node_by_path(refpath);
if (!refnode) { if (!refnode) {
err = -ENOENT; err = -ENOENT;
goto err_out; goto out;
} }
phandle = refnode->phandle; phandle = refnode->phandle;
...@@ -361,9 +361,9 @@ int of_resolve_phandles(struct device_node *overlay) ...@@ -361,9 +361,9 @@ int of_resolve_phandles(struct device_node *overlay)
break; break;
} }
err_out:
pr_err("overlay phandle fixup failed: %d\n", err);
out: out:
if (err)
pr_err("overlay phandle fixup failed: %d\n", err);
of_node_put(tree_symbols); of_node_put(tree_symbols);
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment