aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2013-02-25 06:34:09 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-03-03 21:58:45 -0500
commit0a4cccaa314de37e6130a31e2092778e87c793ae (patch)
treea62ec2ee020e9165198096b6d0c42cbb68fc9664 /drivers/regulator
parent6dbe51c251a327e012439c4772097a13df43c5b8 (diff)
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. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/tps6586x-regulator.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/regulator/tps6586x-regulator.c b/drivers/regulator/tps6586x-regulator.c
index e68382d0e1ea..4e3e4adb1dce 100644
--- a/drivers/regulator/tps6586x-regulator.c
+++ b/drivers/regulator/tps6586x-regulator.c
@@ -304,14 +304,12 @@ static struct tps6586x_platform_data *tps6586x_parse_regulator_dt(
304 } 304 }
305 305
306 err = of_regulator_match(&pdev->dev, regs, tps6586x_matches, num); 306 err = of_regulator_match(&pdev->dev, regs, tps6586x_matches, num);
307 of_node_put(regs);
307 if (err < 0) { 308 if (err < 0) {
308 dev_err(&pdev->dev, "Regulator match failed, e %d\n", err); 309 dev_err(&pdev->dev, "Regulator match failed, e %d\n", err);
309 of_node_put(regs);
310 return NULL; 310 return NULL;
311 } 311 }
312 312
313 of_node_put(regs);
314
315 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); 313 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
316 if (!pdata) { 314 if (!pdata) {
317 dev_err(&pdev->dev, "Memory alloction failed\n"); 315 dev_err(&pdev->dev, "Memory alloction failed\n");