Skip to contentSkip to conversation

ARM: rockchip: pm: Fix PTR_ERR() argument

PATCH New Fabio Estevam 3 participants 3 messages Aug 14, 2015 – Aug 24, 2015

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

PATCH 1/1 ARM: rockchip: pm: Fix PTR_ERR() argument

From: Fabio Estevam <[email protected]>

PTR_ERR should access the value just tested by IS_ERR.

The semantic patch that makes this change is available in scripts/coccinelle/tests/odd_ptr_err.cocci.

---
 arch/arm/mach-rockchip/pm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-rockchip/pm.c +2 -2
index 892bace..01123dd 100644
@@ -224,14 +224,14 @@ static int rk3288_suspend_init(struct device_node *np)
 				"rockchip,rk3288-sgrf");
 	if (IS_ERR(sgrf_regmap)) {
 		pr_err("%s: could not find sgrf regmap\n", __func__);
-		return PTR_ERR(pmu_regmap);
+		return PTR_ERR(sgrf_regmap);
 	}
 
 	grf_regmap = syscon_regmap_lookup_by_compatible(
 				"rockchip,rk3288-grf");
 	if (IS_ERR(grf_regmap)) {
 		pr_err("%s: could not find grf regmap\n", __func__);
-		return PTR_ERR(pmu_regmap);
+		return PTR_ERR(grf_regmap);
 	}
 
 	sram_np = of_find_compatible_node(NULL, NULL,
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 ARM: rockchip: pm: Fix PTR_ERR() argument

Quoted 9 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

PTR_ERR should access the value just tested by IS_ERR.

The semantic patch that makes this change is available in scripts/coccinelle/tests/odd_ptr_err.cocci.

---

Quoted 24 lines
 arch/arm/mach-rockchip/pm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-rockchip/pm.c +2 -2
index 892bace..01123dd 100644
@@ -224,14 +224,14 @@ static int rk3288_suspend_init(struct device_node *np)
 "rockchip,rk3288-sgrf");
 	if (IS_ERR(sgrf_regmap)) {
 		pr_err("%s: could not find sgrf regmap\n", __func__);
-		return PTR_ERR(pmu_regmap);
+		return PTR_ERR(sgrf_regmap);
 	}
 
 	grf_regmap = syscon_regmap_lookup_by_compatible(
 				"rockchip,rk3288-grf");
 	if (IS_ERR(grf_regmap)) {
 		pr_err("%s: could not find grf regmap\n", __func__);
-		return PTR_ERR(pmu_regmap);
+		return PTR_ERR(grf_regmap);
 	}
 
 	sram_np = of_find_compatible_node(NULL, NULL,
maintainer Applied
#2 lore raw

PATCH 1/1 ARM: rockchip: pm: Fix PTR_ERR() argument

In reply to Fabio Estevam

Am Donnerstag, 13. August 2015, 23:43:19 schrieb Fabio Estevam:

Quoted 8 lines

From: Fabio Estevam <[email protected]>

PTR_ERR should access the value just tested by IS_ERR.

The semantic patch that makes this change is available in scripts/coccinelle/tests/odd_ptr_err.cocci.

applied to my soc branch.

Thanks for the catch
Heiko