summaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2022-11-25 10:36:26 +0300
committerLee Jones <lee@kernel.org>2022-12-08 17:41:29 +0300
commit14f8c55d48e02157519fbcb3a5de557abd8a06e2 (patch)
treea57101b08118f4a071d795186fdaa35270dc71b6 /drivers/mfd
parentcb83cb0dfa821b9c91cc9b2e3473f0ea42e11461 (diff)
downloadlinux-14f8c55d48e02157519fbcb3a5de557abd8a06e2.tar.xz
mfd: pm8008: Fix return value check in pm8008_probe()
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> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221125073626.1868229-1-yangyingliang@huawei.com
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/qcom-pm8008.c4
1 files 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);