Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1723367

[PATCH] regulator: da9063: Return an error code on probe failure

From Dan Carpenter <dan.carpenter@oracle.com>
Newsgroups linux.kernel
Subject [PATCH] regulator: da9063: Return an error code on probe failure
Date 2017-08-30 16:10 +0200
Message-ID <ukbQT-R3-43@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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: 69ca3e58d178 ("regulator: da9063: Add Dialog DA9063 voltage regulators support.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/regulator/da9063-regulator.c b/drivers/regulator/da9063-regulator.c
index c6af343f54ea..6a8f9cd69f52 100644
--- a/drivers/regulator/da9063-regulator.c
+++ b/drivers/regulator/da9063-regulator.c
@@ -736,7 +736,7 @@ static int da9063_regulator_probe(struct platform_device *pdev)
 	if (IS_ERR(regl_pdata) || regl_pdata->n_regulators == 0) {
 		dev_err(&pdev->dev,
 			"No regulators defined for the platform\n");
-		return PTR_ERR(regl_pdata);
+		return -ENODEV;
 	}
 
 	/* Find regulators set for particular device model */

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] regulator: da9063: Return an error code on probe failure Dan Carpenter <dan.carpenter@oracle.com> - 2017-08-30 16:10 +0200
  Applied "regulator: da9063: Return an error code on probe failure" to the regulator tree Mark Brown <broonie@kernel.org> - 2017-08-30 17:30 +0200

csiph-web