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 <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Acked-by: Guru Das Srinagesh <[email protected]> Signed-off-by: Lee Jones <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent cb83cb0 commit 14f8c55

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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)