Skip to content

Commit

Permalink
mfd: pm8008: Fix return value check in pm8008_probe()
Browse files Browse the repository at this point in the history
[ Upstream commit 14f8c55 ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Yang Yingliang authored and gregkh committed Dec 31, 2022
1 parent ec10848 commit 5c94063
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mfd/qcom-pm8008.c
Expand Up @@ -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);

Expand Down

0 comments on commit 5c94063

Please sign in to comment.