Skip to contentSkip to conversation

regulator: tps6586x: (cosmetic) simplify a conditional

PATCH Applied Guennadi Liakhovetski 2 participants 2 messages Feb 25, 2013 – Mar 1, 2013 Voltage and current regulator framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regulator: tps6586x: (cosmetic) simplify a conditional

of_node_put() is called on either branch of a conditional, simplify the code by only calling it once.

---
 drivers/regulator/tps6586x-regulator.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/regulator/tps6586x-regulator.c +1 -3
index f86da67..1471ead 100644
@@ -338,14 +338,12 @@ static struct tps6586x_platform_data *tps6586x_parse_regulator_dt(
 	}
 
 	err = of_regulator_match(&pdev->dev, regs, tps6586x_matches, num);
+	of_node_put(regs);
 	if (err < 0) {
 		dev_err(&pdev->dev, "Regulator match failed, e %d\n", err);
-		of_node_put(regs);
 		return NULL;
 	}
 
-	of_node_put(regs);
-
 	pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
 	if (!pdata) {
 		dev_err(&pdev->dev, "Memory alloction failed\n");
Signature · 1 line
1.7.2.5
Applied
#1 lore raw
Quoted 2 lines · Guennadi Liakhovetski

of_node_put() is called on either branch of a conditional, simplify the code by only calling it once.

Applied, thanks.