From: Ezequiel Garcia Date: Fri, 25 Jan 2013 12:19:47 +0000 (-0300) Subject: ARM: OMAP2+: gpmc: Remove unneeded of_node_put() X-Git-Url: http://git.mmlx.us/?a=commitdiff_plain;h=a16723709cff6d69567024c28d32d1344f08cecf;p=linux-edison.git ARM: OMAP2+: gpmc: Remove unneeded of_node_put() 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 Signed-off-by: Ezequiel Garcia Acked-by: Jon Hunter Signed-off-by: Tony Lindgren --- diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index 01ce462e265..c6255f788ab 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c @@ -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;