mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 08:46:46 +00:00
mfd: pm8008: Fix return value check in pm8008_probe()
[ Upstream commit14f8c55d48
] 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:6b149f3310
("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>
This commit is contained in:
parent
ec10848e26
commit
5c940632ca
1 changed files with 2 additions and 2 deletions
|
@ -215,8 +215,8 @@ static int pm8008_probe(struct i2c_client *client)
|
||||||
|
|
||||||
dev = &client->dev;
|
dev = &client->dev;
|
||||||
regmap = devm_regmap_init_i2c(client, &qcom_mfd_regmap_cfg);
|
regmap = devm_regmap_init_i2c(client, &qcom_mfd_regmap_cfg);
|
||||||
if (!regmap)
|
if (IS_ERR(regmap))
|
||||||
return -ENODEV;
|
return PTR_ERR(regmap);
|
||||||
|
|
||||||
i2c_set_clientdata(client, regmap);
|
i2c_set_clientdata(client, regmap);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue