Skip to content

Commit

Permalink
ARM: OMAP2+: gpmc: Remove unneeded of_node_put()
Browse files Browse the repository at this point in the history
for_each_node_by_name() automatically calls of_node_put() on each
node passed; so don't do it explicitly unless there's an error.

Reported-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Jon Hunter <jon-hunter@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Ezequiel Garcia authored and Tony Lindgren committed Feb 1, 2013
1 parent bc6b1e7 commit a167237
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/arm/mach-omap2/gpmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1271,9 +1271,10 @@ static int gpmc_probe_dt(struct platform_device *pdev)

for_each_node_by_name(child, "nand") {
ret = gpmc_probe_nand_child(pdev, child);
of_node_put(child);
if (ret < 0)
if (ret < 0) {
of_node_put(child);
return ret;
}
}

return 0;
Expand Down

0 comments on commit a167237

Please sign in to comment.