linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regulator: max20086: fix error code in max20086_parse_regulators_dt()
@ 2022-01-11  7:26 Dan Carpenter
  2022-01-11  9:11 ` Laurent Pinchart
  2022-01-11 14:21 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2022-01-11  7:26 UTC (permalink / raw)
  To: Laurent Pinchart, Watson Chow
  Cc: Liam Girdwood, Mark Brown, linux-kernel, kernel-janitors

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>
---
 drivers/regulator/max20086-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/max20086-regulator.c b/drivers/regulator/max20086-regulator.c
index fbc56b043071..63aa6ec3254a 100644
--- a/drivers/regulator/max20086-regulator.c
+++ b/drivers/regulator/max20086-regulator.c
@@ -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)
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] regulator: max20086: fix error code in max20086_parse_regulators_dt()
  2022-01-11  7:26 [PATCH] regulator: max20086: fix error code in max20086_parse_regulators_dt() Dan Carpenter
@ 2022-01-11  9:11 ` Laurent Pinchart
  2022-01-11 14:21 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Laurent Pinchart @ 2022-01-11  9:11 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Watson Chow, Liam Girdwood, Mark Brown, linux-kernel, kernel-janitors

Hi Dan,

Thank you for the patch.

On Tue, Jan 11, 2022 at 10:26:58AM +0300, Dan Carpenter wrote:
> This code accidentally returns PTR_ERR(NULL) which is success.  It
> should return a negative error code.

Oops, sorry.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> Fixes: bfff546aae50 ("regulator: Add MAX20086-MAX20089 driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/regulator/max20086-regulator.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/regulator/max20086-regulator.c b/drivers/regulator/max20086-regulator.c
> index fbc56b043071..63aa6ec3254a 100644
> --- a/drivers/regulator/max20086-regulator.c
> +++ b/drivers/regulator/max20086-regulator.c
> @@ -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)

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] regulator: max20086: fix error code in max20086_parse_regulators_dt()
  2022-01-11  7:26 [PATCH] regulator: max20086: fix error code in max20086_parse_regulators_dt() Dan Carpenter
  2022-01-11  9:11 ` Laurent Pinchart
@ 2022-01-11 14:21 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2022-01-11 14:21 UTC (permalink / raw)
  To: Dan Carpenter, Watson Chow, Laurent Pinchart
  Cc: linux-kernel, Liam Girdwood, kernel-janitors

On Tue, 11 Jan 2022 10:26:58 +0300, Dan Carpenter wrote:
> This code accidentally returns PTR_ERR(NULL) which is success.  It
> should return a negative error code.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-linus

Thanks!

[1/1] regulator: max20086: fix error code in max20086_parse_regulators_dt()
      commit: 879cf8006475642b747aaaa4d06f7044ab2de794

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-11 14:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-11  7:26 [PATCH] regulator: max20086: fix error code in max20086_parse_regulators_dt() Dan Carpenter
2022-01-11  9:11 ` Laurent Pinchart
2022-01-11 14:21 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).