Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a4cccaa authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Mark Brown
Browse files

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: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 6dbe51c2
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -304,14 +304,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");