regulator: uniphier: Fix probe error handling
authorAxel Lin <axel.lin@ingics.com>
Wed, 30 Jan 2019 07:11:09 +0000 (15:11 +0800)
committerMark Brown <broonie@kernel.org>
Sat, 2 Feb 2019 16:00:04 +0000 (16:00 +0000)
Ensure unwind all resources if probe fails.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/uniphier-regulator.c

index abf22acbd13e6e2238ac32d1ab358914b4dc79da..6ba0ae405f2beae162f7cd495130802bed305a26 100644 (file)
@@ -87,8 +87,10 @@ static int uniphier_regulator_probe(struct platform_device *pdev)
        }
 
        regmap = devm_regmap_init_mmio(dev, base, priv->data->regconf);
-       if (IS_ERR(regmap))
-               return PTR_ERR(regmap);
+       if (IS_ERR(regmap)) {
+               ret = PTR_ERR(regmap);
+               goto out_rst_assert;
+       }
 
        config.dev = dev;
        config.driver_data = priv;