Skip to content

Commit

Permalink
ARM: OMAP3: Use common error handling code in omap3xxx_hwmod_init()
Browse files Browse the repository at this point in the history
Add a jump target so that a bit of exception handling can be better reused
at the end of this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Markus Elfring authored and Tony Lindgren committed Oct 25, 2017
1 parent d25c70c commit f33aadd
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -3208,18 +3208,14 @@ int __init omap3xxx_hwmod_init(void)

if (h_sham && omap3xxx_hwmod_is_hs_ip_block_usable(bus, "sham")) {
r = omap_hwmod_register_links(h_sham);
if (r < 0) {
of_node_put(bus);
return r;
}
if (r < 0)
goto put_node;
}

if (h_aes && omap3xxx_hwmod_is_hs_ip_block_usable(bus, "aes")) {
r = omap_hwmod_register_links(h_aes);
if (r < 0) {
of_node_put(bus);
return r;
}
if (r < 0)
goto put_node;
}
of_node_put(bus);

Expand Down Expand Up @@ -3270,4 +3266,8 @@ int __init omap3xxx_hwmod_init(void)
r = omap_hwmod_register_links(omap3xxx_dss_hwmod_ocp_ifs);

return r;

put_node:
of_node_put(bus);
return r;
}

0 comments on commit f33aadd

Please sign in to comment.