Commit 33cd870c4bf148163e8b7c6e3bac2a44658a04e4

Authored by Axel Lin
Committed by Mark Brown
1 parent d023377093

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>

Showing 1 changed file with 4 additions and 2 deletions Side-by-side Diff

drivers/regulator/uniphier-regulator.c
... ... @@ -87,8 +87,10 @@
87 87 }
88 88  
89 89 regmap = devm_regmap_init_mmio(dev, base, priv->data->regconf);
90   - if (IS_ERR(regmap))
91   - return PTR_ERR(regmap);
  90 + if (IS_ERR(regmap)) {
  91 + ret = PTR_ERR(regmap);
  92 + goto out_rst_assert;
  93 + }
92 94  
93 95 config.dev = dev;
94 96 config.driver_data = priv;