From: Geert Uytterhoeven Date: Fri, 15 Jul 2022 14:03:15 +0000 (+0200) Subject: of: overlay: Simplify of_overlay_fdt_apply() tail X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e76f4a6107ebe4af5405bb1b94d0e717a40fd306;p=linux.git of: overlay: Simplify of_overlay_fdt_apply() tail 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 Reviewed-by: Frank Rowand Tested-by: Frank Rowand Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/6a3357a8f7f29704350e3ffae768ee8a462b54d3.1657893306.git.geert+renesas@glider.be --- diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index 84a8d402009cb..bd8ff4df723da 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c @@ -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);