All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH resend] mfd: pm8008: Fix return value check in pm8008_probe()
@ 2022-11-25  7:36 Yang Yingliang
  2022-12-08 14:39 ` Lee Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Yingliang @ 2022-11-25  7:36 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, lee, gurus; +Cc: linux-arm-msm, yangyingliang

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

Fixes: 6b149f3310a4 ("mfd: pm8008: Add driver for QCOM PM8008 PMIC")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Acked-by: Guru Das Srinagesh <gurus@codeaurora.org>
---
The previous patch link:
https://lore.kernel.org/lkml/20210605022446.4119978-1-yangyingliang@huawei.com/
---
 drivers/mfd/qcom-pm8008.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/qcom-pm8008.c b/drivers/mfd/qcom-pm8008.c
index 4b8ff947762f..9f3c4a01b4c1 100644
--- a/drivers/mfd/qcom-pm8008.c
+++ b/drivers/mfd/qcom-pm8008.c
@@ -215,8 +215,8 @@ static int pm8008_probe(struct i2c_client *client)
 
 	dev = &client->dev;
 	regmap = devm_regmap_init_i2c(client, &qcom_mfd_regmap_cfg);
-	if (!regmap)
-		return -ENODEV;
+	if (IS_ERR(regmap))
+		return PTR_ERR(regmap);
 
 	i2c_set_clientdata(client, regmap);
 
-- 
2.25.1


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

end of thread, other threads:[~2022-12-08 14:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-25  7:36 [PATCH resend] mfd: pm8008: Fix return value check in pm8008_probe() Yang Yingliang
2022-12-08 14:39 ` Lee Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.