Skip to content

Commit 14f8c55

Browse files
Yang Yinglianglag-linaro
authored andcommitted
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: 6b149f3 ("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
1 parent cb83cb0 commit 14f8c55

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/mfd/qcom-pm8008.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ static int pm8008_probe(struct i2c_client *client)
215215

216216
dev = &client->dev;
217217
regmap = devm_regmap_init_i2c(client, &qcom_mfd_regmap_cfg);
218-
if (!regmap)
219-
return -ENODEV;
218+
if (IS_ERR(regmap))
219+
return PTR_ERR(regmap);
220220

221221
i2c_set_clientdata(client, regmap);
222222

0 commit comments

Comments
 (0)