Skip to contentSkip to conversation

ARM: omap2: gpmc: Remove unneeded of_node_put()

PATCH New Ezequiel Garcia 3 participants 3 messages Jan 25, 2013 – Feb 1, 2013

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 arch/arm/mach-omap2/gpmc.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/gpmc.c +3 -2
index 01ce462..c6255f7 100644
@@ -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;
Signature · 1 line
1.7.8.6
#1 lore raw

PATCH 1/1 ARM: omap2: gpmc: Remove unneeded of_node_put()

Quoted 17 lines · Ezequiel Garcia

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.

---
 arch/arm/mach-omap2/gpmc.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/gpmc.c +0 -0
index 01ce462..c6255f7 100644
@@ -1271,9 +1271,10 @@ static int gpmc_probe_dt(struct platform_device *pdev)
 
 	for_each_node_by_name(child, "nand") {

arch/arm/mach-omap2/gpmc.c static int gpmc_probe_dt(struct platform_device *pdev) · line 1280

Quoted 10 lines
arch/arm/mach-omap2/gpmc.c +3 -2
 		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;

Thanks!
Jon

maintainer
#2 lore raw

PATCH 1/1 ARM: omap2: gpmc: Remove unneeded of_node_put()

Quoted 27 lines · Jon Hunter
Quoted 25 lines · Ezequiel Garcia

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.

---
 arch/arm/mach-omap2/gpmc.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/gpmc.c +3 -2
index 01ce462..c6255f7 100644
@@ -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;
+		}
 	}
 
Quoted 4 lines

arch/arm/mach-omap2/gpmc.c static int gpmc_probe_dt(struct platform_device *pdev) · line 1280

Quoted 2 lines
arch/arm/mach-omap2/gpmc.c +0 -0
 	return 0;

Thanks applying into omap-for-v3.9/gpmc.

Tony