linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: omap2: gpmc: Remove unneeded of_node_put()
@ 2013-01-25 12:19 Ezequiel Garcia
  2013-01-25 14:18 ` Jon Hunter
  0 siblings, 1 reply; 3+ messages in thread
From: Ezequiel Garcia @ 2013-01-25 12:19 UTC (permalink / raw)
  To: linux-arm-kernel

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>
---
 arch/arm/mach-omap2/gpmc.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 01ce462..c6255f7 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;
-- 
1.7.8.6

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-02-01 21:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-25 12:19 [PATCH] ARM: omap2: gpmc: Remove unneeded of_node_put() Ezequiel Garcia
2013-01-25 14:18 ` Jon Hunter
2013-02-01 21:59   ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).