regulator: max20086: fix error code in max20086_parse_regulators_dt()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 11 Jan 2022 07:26:58 +0000 (10:26 +0300)
committerMark Brown <broonie@kernel.org>
Tue, 11 Jan 2022 13:48:49 +0000 (13:48 +0000)
This code accidentally returns PTR_ERR(NULL) which is success.  It
should return a negative error code.

Fixes: bfff546aae50 ("regulator: Add MAX20086-MAX20089 driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20220111072657.GK11243@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/max20086-regulator.c

index fbc56b043071349720bf8f2d2b36589213d322b0..63aa6ec3254ac69ef5ee6f09b32d5af100127955 100644 (file)
@@ -140,7 +140,7 @@ static int max20086_parse_regulators_dt(struct max20086 *chip, bool *boot_on)
        node = of_get_child_by_name(chip->dev->of_node, "regulators");
        if (!node) {
                dev_err(chip->dev, "regulators node not found\n");
-               return PTR_ERR(node);
+               return -ENODEV;
        }
 
        for (i = 0; i < chip->info->num_outputs; ++i)