lkml.org 
[lkml]   [2019]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] regulator: uniphier: Fix probe error handling
Hi Axel,

On Wed, 30 Jan 2019 15:11:09 +0800 <axel.lin@ingics.com> wrote:

> Ensure unwind all resources if probe fails.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> drivers/regulator/uniphier-regulator.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> 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;
> + }

Surely this return without asserting resets is wrong. This looks good to me.

Reviewed-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>

Thank you,

---
Best Regards,
Kunihiko Hayashi


\
 
 \ /
  Last update: 2019-01-30 10:05    [W:0.041 / U:3.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site