Skip to contentSkip to conversation

regulator: arizona-ldo1: Drop OF node reference on error path

PATCH Applied Charles Keepax 2 participants 4 messages Feb 20, 2015 – Feb 21, 2015

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

PATCH 1/2 regulator: arizona-ldo1: Drop OF node reference on error path

We were not calling of_node_put if the regulator failed to register this patch fixes this.

---
 drivers/regulator/arizona-ldo1.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/regulator/arizona-ldo1.c +3 -2
index 8169165..a1d07d3 100644
@@ -282,6 +282,9 @@ static int arizona_ldo1_probe(struct platform_device *pdev)
 		arizona->external_dcvdd = true;
 
 	ldo1->regulator = devm_regulator_register(&pdev->dev, desc, &config);
+
+	of_node_put(config.of_node);
+
 	if (IS_ERR(ldo1->regulator)) {
 		ret = PTR_ERR(ldo1->regulator);
 		dev_err(arizona->dev, "Failed to register LDO1 supply: %d\n",
@@ -289,8 +292,6 @@ static int arizona_ldo1_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	of_node_put(config.of_node);
-
 	platform_set_drvdata(pdev, ldo1);
 
 	return 0;
Signature · 1 line
1.7.2.5
#1 lore raw

PATCH 2/2 regulator: arizona-micsupp: Drop OF node reference on error path

We were not calling of_node_put if the regulator failed to register this patch fixes this.

---
 drivers/regulator/arizona-micsupp.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/regulator/arizona-micsupp.c +3 -2
index 2007900..4116e74 100644
@@ -284,6 +284,9 @@ static int arizona_micsupp_probe(struct platform_device *pdev)
 	micsupp->regulator = devm_regulator_register(&pdev->dev,
 						     desc,
 						     &config);
+
+	of_node_put(config.of_node);
+
 	if (IS_ERR(micsupp->regulator)) {
 		ret = PTR_ERR(micsupp->regulator);
 		dev_err(arizona->dev, "Failed to register mic supply: %d\n",
@@ -291,8 +294,6 @@ static int arizona_micsupp_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	of_node_put(config.of_node);
-
 	platform_set_drvdata(pdev, micsupp);
 
 	return 0;
Signature · 1 line
1.7.2.5
maintainer Applied
#2 lore raw

Re: [PATCH 2/2] regulator: arizona-micsupp: Drop OF node reference on error path

Quoted 2 lines · Charles Keepax

We were not calling of_node_put if the regulator failed to register this patch fixes this.

Applied, thanks.

maintainer Applied
#3 lore raw
In reply to Charles Keepax
Quoted 2 lines · Charles Keepax

We were not calling of_node_put if the regulator failed to register this patch fixes this.

Applied, thanks.