Skip to content

Commit

Permalink
regulator: bd9576: Fix return from bd957x_probe()
Browse files Browse the repository at this point in the history
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: b014e9f ("regulator: Support ROHM BD9576MUF and BD9573MUF")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/YEsbfLJfEWtnRpoU@mwanda
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Dan Carpenter authored and Mark Brown committed Mar 15, 2021
1 parent 45ee8b7 commit 320fcd6
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions drivers/regulator/bd9576-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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
Expand All @@ -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[] = {
Expand Down

0 comments on commit 320fcd6

Please sign in to comment.