Skip to content

Commit

Permalink
of: overlay: Simplify of_overlay_fdt_apply() tail
Browse files Browse the repository at this point in the history
It does not hurt to fill in the changeset id while the mutex is still
held.  After doing so, the function tails for the success and failure
cases become identical, so they can be unified.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Frank Rowand <frank.rowand@sony.com>
Tested-by: Frank Rowand <frank.rowand@sony.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/6a3357a8f7f29704350e3ffae768ee8a462b54d3.1657893306.git.geert+renesas@glider.be
  • Loading branch information
Geert Uytterhoeven authored and Rob Herring committed Jul 19, 2022
1 parent e385b0b commit e76f4a6
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions drivers/of/overlay.c
Original file line number Diff line number Diff line change
Expand Up @@ -1043,20 +1043,15 @@ int of_overlay_fdt_apply(const void *overlay_fdt, u32 overlay_fdt_size,
* goto err_free_ovcs. Instead, the caller of of_overlay_fdt_apply()
* can call of_overlay_remove();
*/

mutex_unlock(&of_mutex);
of_overlay_mutex_unlock();

*ret_ovcs_id = ovcs->id;

return ret;
goto out_unlock;

err_free_ovcs:
free_overlay_changeset(ovcs);

out_unlock:
mutex_unlock(&of_mutex);
of_overlay_mutex_unlock();

return ret;
}
EXPORT_SYMBOL_GPL(of_overlay_fdt_apply);
Expand Down

0 comments on commit e76f4a6

Please sign in to comment.