Commit 320fcd6b authored by Dan Carpenter's avatar Dan Carpenter Committed by Mark Brown

regulator: bd9576: Fix return from bd957x_probe()

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: b014e9fa ("regulator: Support ROHM BD9576MUF and BD9573MUF")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarMatti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/YEsbfLJfEWtnRpoU@mwandaSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 45ee8b79
...@@ -206,7 +206,7 @@ static int bd957x_probe(struct platform_device *pdev) ...@@ -206,7 +206,7 @@ static int bd957x_probe(struct platform_device *pdev)
{ {
struct regmap *regmap; struct regmap *regmap;
struct regulator_config config = { 0 }; struct regulator_config config = { 0 };
int i, err; int i;
bool vout_mode, ddr_sel; bool vout_mode, ddr_sel;
const struct bd957x_regulator_data *reg_data = &bd9576_regulators[0]; const struct bd957x_regulator_data *reg_data = &bd9576_regulators[0];
unsigned int num_reg_data = ARRAY_SIZE(bd9576_regulators); unsigned int num_reg_data = ARRAY_SIZE(bd9576_regulators);
...@@ -279,8 +279,7 @@ static int bd957x_probe(struct platform_device *pdev) ...@@ -279,8 +279,7 @@ static int bd957x_probe(struct platform_device *pdev)
break; break;
default: default:
dev_err(&pdev->dev, "Unsupported chip type\n"); dev_err(&pdev->dev, "Unsupported chip type\n");
err = -EINVAL; return -EINVAL;
goto err;
} }
config.dev = pdev->dev.parent; config.dev = pdev->dev.parent;
...@@ -300,8 +299,7 @@ static int bd957x_probe(struct platform_device *pdev) ...@@ -300,8 +299,7 @@ static int bd957x_probe(struct platform_device *pdev)
dev_err(&pdev->dev, dev_err(&pdev->dev,
"failed to register %s regulator\n", "failed to register %s regulator\n",
desc->name); desc->name);
err = PTR_ERR(rdev); return PTR_ERR(rdev);
goto err;
} }
/* /*
* Clear the VOUT1 GPIO setting - rest of the regulators do not * Clear the VOUT1 GPIO setting - rest of the regulators do not
...@@ -310,8 +308,7 @@ static int bd957x_probe(struct platform_device *pdev) ...@@ -310,8 +308,7 @@ static int bd957x_probe(struct platform_device *pdev)
config.ena_gpiod = NULL; config.ena_gpiod = NULL;
} }
err: return 0;
return err;
} }
static const struct platform_device_id bd957x_pmic_id[] = { static const struct platform_device_id bd957x_pmic_id[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment