Commit b6615659 authored by Dan Carpenter's avatar Dan Carpenter Committed by Mark Brown

regulator: da9063: Return an error code on probe failure

If "regl_pdata->n_regulators == 0" is true then we accidentally return
PTR_ERR(<some_valid_pointer>) instead of an error code.  I've changed it
to return -ENODEV instead.

Fixes: 69ca3e58 ("regulator: da9063: Add Dialog DA9063 voltage regulators support.")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 5771a8c0
...@@ -736,7 +736,7 @@ static int da9063_regulator_probe(struct platform_device *pdev) ...@@ -736,7 +736,7 @@ static int da9063_regulator_probe(struct platform_device *pdev)
if (IS_ERR(regl_pdata) || regl_pdata->n_regulators == 0) { if (IS_ERR(regl_pdata) || regl_pdata->n_regulators == 0) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"No regulators defined for the platform\n"); "No regulators defined for the platform\n");
return PTR_ERR(regl_pdata); return -ENODEV;
} }
/* Find regulators set for particular device model */ /* Find regulators set for particular device model */
......
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