regulator: uniphier: Fix probe error handling

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>
This commit is contained in:
Axel Lin 2019-01-30 15:11:09 +08:00 committed by Mark Brown
parent d023377093
commit 33cd870c4b
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0

View 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;