diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2017-12-08 08:13:03 -0500 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2017-12-08 10:32:18 -0500 |
commit | 589b754df3f37ca0a1f96fccde7f91c59266f38a (patch) | |
tree | 1459754b9d9acc2ffac8525bed6691e15913c6e2 | |
parent | 35e691eddca565f475ba69ff84ca0c9db3b3257b (diff) |
of: overlay: Make node skipping in init_overlay_changeset() clearer
Make it more clear that nodes without "__overlay__" subnodes are
skipped, by reverting the logic and using continue.
This also reduces indentation level.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Rob Herring <robh@kernel.org>
-rw-r--r-- | drivers/of/overlay.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index 83bb2edfc65c..3981b7da4fa9 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c | |||
@@ -573,18 +573,19 @@ static int init_overlay_changeset(struct overlay_changeset *ovcs, | |||
573 | cnt = 0; | 573 | cnt = 0; |
574 | for_each_child_of_node(tree, node) { | 574 | for_each_child_of_node(tree, node) { |
575 | overlay_node = of_get_child_by_name(node, "__overlay__"); | 575 | overlay_node = of_get_child_by_name(node, "__overlay__"); |
576 | if (overlay_node) { | 576 | if (!overlay_node) |
577 | fragment = &fragments[cnt]; | 577 | continue; |
578 | fragment->overlay = overlay_node; | ||
579 | fragment->target = find_target_node(node); | ||
580 | if (!fragment->target) { | ||
581 | of_node_put(fragment->overlay); | ||
582 | ret = -EINVAL; | ||
583 | goto err_free_fragments; | ||
584 | } | ||
585 | 578 | ||
586 | cnt++; | 579 | fragment = &fragments[cnt]; |
580 | fragment->overlay = overlay_node; | ||
581 | fragment->target = find_target_node(node); | ||
582 | if (!fragment->target) { | ||
583 | of_node_put(fragment->overlay); | ||
584 | ret = -EINVAL; | ||
585 | goto err_free_fragments; | ||
587 | } | 586 | } |
587 | |||
588 | cnt++; | ||
588 | } | 589 | } |
589 | 590 | ||
590 | /* | 591 | /* |