linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] regulator: rt4831: Fix return value check in rt4831_regulator_probe()
@ 2021-03-05  3:49 'Wei Yongjun
  2021-03-08 16:08 ` Mark Brown
  2021-03-11  3:16 ` cy_huang(黃啟原)
  0 siblings, 2 replies; 3+ messages in thread
From: 'Wei Yongjun @ 2021-03-05  3:49 UTC (permalink / raw)
  To: weiyongjun1, Liam Girdwood, Mark Brown, ChiYuan Huang
  Cc: linux-kernel, kernel-janitors, Hulk Robot

From: Wei Yongjun <weiyongjun1@huawei.com>

In case of error, the function dev_get_regmap() returns NULL
pointer not ERR_PTR(). The IS_ERR() test in the return value
check should be replaced with NULL test.

Fixes: 9351ab8b0cb6 ("regulator: rt4831: Adds support for Richtek RT4831 DSV regulator")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/regulator/rt4831-regulator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/rt4831-regulator.c b/drivers/regulator/rt4831-regulator.c
index 3d4695ded629..e3aaac90d238 100644
--- a/drivers/regulator/rt4831-regulator.c
+++ b/drivers/regulator/rt4831-regulator.c
@@ -153,9 +153,9 @@ static int rt4831_regulator_probe(struct platform_device *pdev)
 	int i, ret;
 
 	regmap = dev_get_regmap(pdev->dev.parent, NULL);
-	if (IS_ERR(regmap)) {
+	if (!regmap) {
 		dev_err(&pdev->dev, "Failed to init regmap\n");
-		return PTR_ERR(regmap);
+		return -ENODEV;
 	}
 
 	/* Configure DSV mode to normal by default */


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

* Re: [PATCH -next] regulator: rt4831: Fix return value check in rt4831_regulator_probe()
  2021-03-05  3:49 [PATCH -next] regulator: rt4831: Fix return value check in rt4831_regulator_probe() 'Wei Yongjun
@ 2021-03-08 16:08 ` Mark Brown
  2021-03-11  3:16 ` cy_huang(黃啟原)
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2021-03-08 16:08 UTC (permalink / raw)
  To: Liam Girdwood, ChiYuan Huang, 'Wei Yongjun
  Cc: Hulk Robot, linux-kernel, kernel-janitors

On Fri, 5 Mar 2021 03:49:30 +0000, 'Wei Yongjun wrote:
> In case of error, the function dev_get_regmap() returns NULL
> pointer not ERR_PTR(). The IS_ERR() test in the return value
> check should be replaced with NULL test.

Applied to

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

Thanks!

[1/1] regulator: rt4831: Fix return value check in rt4831_regulator_probe()
      commit: 2a105d168e74eedbccd9b040c3ee8b8b00604a33

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

* Re: [PATCH -next] regulator: rt4831: Fix return value check in rt4831_regulator_probe()
  2021-03-05  3:49 [PATCH -next] regulator: rt4831: Fix return value check in rt4831_regulator_probe() 'Wei Yongjun
  2021-03-08 16:08 ` Mark Brown
@ 2021-03-11  3:16 ` cy_huang(黃啟原)
  1 sibling, 0 replies; 3+ messages in thread
From: cy_huang(黃啟原) @ 2021-03-11  3:16 UTC (permalink / raw)
  To: lgirdwood, weiyongjun1, broonie; +Cc: linux-kernel, hulkci, kernel-janitors

Many thanks to fix it. I didn't notice this fault.
>  dev_err(&pdev->dev, "Failed to init regmap\n");
> -return PTR_ERR(regmap);
> +return -ENODEV;
>  }
>
>  /* Configure DSV mode to normal by default */
>
************* Email Confidentiality Notice ********************

The information contained in this e-mail message (including any attachments) may be confidential, proprietary, privileged, or otherwise exempt from disclosure under applicable laws. It is intended to be conveyed only to the designated recipient(s). Any use, dissemination, distribution, printing, retaining or copying of this e-mail (including its attachments) by unintended recipient(s) is strictly prohibited and may be unlawful. If you are not an intended recipient of this e-mail, or believe that you have received this e-mail in error, please notify the sender immediately (by replying to this e-mail), delete any and all copies of this e-mail (including any attachments) from your system, and do not disclose the content of this e-mail to any other person. Thank you!

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

end of thread, other threads:[~2021-03-11  3:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-05  3:49 [PATCH -next] regulator: rt4831: Fix return value check in rt4831_regulator_probe() 'Wei Yongjun
2021-03-08 16:08 ` Mark Brown
2021-03-11  3:16 ` cy_huang(黃啟原)

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).