regulator: tps6586x: (cosmetic) simplify a conditional
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Mon, 25 Feb 2013 11:34:09 +0000 (12:34 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 4 Mar 2013 02:58:45 +0000 (10:58 +0800)
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>
drivers/regulator/tps6586x-regulator.c

index e68382d0e1ea1c8025377f1755f90d95a33f172d..4e3e4adb1dcefec44a6e85f6d84c2b8cab614bf0 100644 (file)
@@ -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");