[<prev] [next>] [day] [month] [year] [list]
Message-ID: <ccb359c1-b157-6d41-5fd2-791a368d7cf5@web.de>
Date: Fri, 8 May 2020 13:25:19 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Christophe Jaillet <christophe.jaillet@...adoo.fr>,
linux-pm@...r.kernel.org
Cc: kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org,
Anton Vorontsov <anton.vorontsov@...aro.org>,
Milo Kim <milo.kim@...com>, Sebastian Reichel <sre@...nel.org>
Subject: Re: [PATCH] power: supply: lp8788: Fix an error handling path in
lp8788_charger_probe()
> In case of error, resources allocated in 'lp8788_setup_adc_channel()' must
> be released.
>
> Add a call to 'lp8788_release_adc_channel()' as already done in the remove
> function.
I suggest to omit apostrophes from this commit message.
…
> +++ b/drivers/power/supply/lp8788-charger.c
> @@ -719,13 +719,17 @@ static int lp8788_charger_probe(struct platform_device *pdev)
>
> ret = lp8788_psy_register(pdev, pchg);
> if (ret)
> - return ret;
> + goto err_release_adc_channel;
>
> ret = lp8788_irq_register(pdev, pchg);
…
You propose to perform another channel release only once for this
function implementation.
Thus I find nicer to specify the desired exception handling in
this if branch directly.
Regards,
Markus
Powered by blists - more mailing lists