From: Axel Lin Date: Wed, 30 Jan 2019 07:11:09 +0000 (+0800) Subject: regulator: uniphier: Fix probe error handling X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=33cd870c4bf148163e8b7c6e3bac2a44658a04e4;p=openwrt%2Fstaging%2Fblogic.git regulator: uniphier: Fix probe error handling Ensure unwind all resources if probe fails. Signed-off-by: Axel Lin Reviewed-by: Kunihiko Hayashi Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/uniphier-regulator.c b/drivers/regulator/uniphier-regulator.c index abf22acbd13e..6ba0ae405f2b 100644 --- a/drivers/regulator/uniphier-regulator.c +++ b/drivers/regulator/uniphier-regulator.c @@ -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;