[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0d1bdcff83fcd875a968cc4fe5c4943e08e44a6b.camel@fi.rohmeurope.com>
Date: Mon, 15 Mar 2021 07:27:25 +0200
From: Matti Vaittinen <matti.vaittinen@...rohmeurope.com>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>, linux-power@...rohmeurope.com,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] regulator: bd9576: Fix return from bd957x_probe()
On Fri, 2021-03-12 at 10:42 +0300, Dan Carpenter wrote:
> The probe() function returns an uninitialized variable in the success
> path. There is no need for the "err" variable at all, just delete
> it.
>
> Fixes: b014e9fae7e7 ("regulator: Support ROHM BD9576MUF and
> BD9573MUF")
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
Thanks for killing the bug Dan! Very much appreciated.
By the way, this is going to conflict with the regulator notification
extension RFC series. I will rebase the RFC when this gets in tree.
Reviewed-by: Matti Vaittinen <matti.vaittinen@...rohmeurope.com>
> ---
> drivers/regulator/bd9576-regulator.c | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/regulator/bd9576-regulator.c
> b/drivers/regulator/bd9576-regulator.c
> index a8b5832a5a1b..204a2da054f5 100644
> --- a/drivers/regulator/bd9576-regulator.c
> +++ b/drivers/regulator/bd9576-regulator.c
> @@ -206,7 +206,7 @@ static int bd957x_probe(struct platform_device
> *pdev)
> {
> struct regmap *regmap;
> struct regulator_config config = { 0 };
> - int i, err;
> + int i;
> bool vout_mode, ddr_sel;
> const struct bd957x_regulator_data *reg_data =
> &bd9576_regulators[0];
> unsigned int num_reg_data = ARRAY_SIZE(bd9576_regulators);
> @@ -279,8 +279,7 @@ static int bd957x_probe(struct platform_device
> *pdev)
> break;
> default:
> dev_err(&pdev->dev, "Unsupported chip type\n");
> - err = -EINVAL;
> - goto err;
> + return -EINVAL;
> }
>
> config.dev = pdev->dev.parent;
> @@ -300,8 +299,7 @@ static int bd957x_probe(struct platform_device
> *pdev)
> dev_err(&pdev->dev,
> "failed to register %s regulator\n",
> desc->name);
> - err = PTR_ERR(rdev);
> - goto err;
> + return PTR_ERR(rdev);
> }
> /*
> * Clear the VOUT1 GPIO setting - rest of the
> regulators do not
> @@ -310,8 +308,7 @@ static int bd957x_probe(struct platform_device
> *pdev)
> config.ena_gpiod = NULL;
> }
>
> -err:
> - return err;
> + return 0;
> }
>
> static const struct platform_device_id bd957x_pmic_id[] = {
Powered by blists - more mailing lists