Commit 0a4cccaa314de37e6130a31e2092778e87c793ae

Authored by Guennadi Liakhovetski
Committed by Mark Brown
1 parent 6dbe51c251

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>

Showing 1 changed file with 1 additions and 3 deletions Side-by-side Diff

drivers/regulator/tps6586x-regulator.c
... ... @@ -304,13 +304,11 @@
304 304 }
305 305  
306 306 err = of_regulator_match(&pdev->dev, regs, tps6586x_matches, num);
  307 + of_node_put(regs);
307 308 if (err < 0) {
308 309 dev_err(&pdev->dev, "Regulator match failed, e %d\n", err);
309   - of_node_put(regs);
310 310 return NULL;
311 311 }
312   -
313   - of_node_put(regs);
314 312  
315 313 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
316 314 if (!pdata) {