mfd: pm8008: Fix return value check in pm8008_probe()
Subsystems (2)
PATCH RESEND 1/1 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 <[email protected]>
Reviewed-by Bjorn Andersson <[email protected]>
---
The previous patch link:
https://lore.kernel.org/lkml/[email protected]/
--- drivers/mfd/qcom-pm8008.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/qcom-pm8008.c +2 -2
@@ -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);
Signature · 1 line
2.25.1
Quoted 8 lines · Yang Yingliang
In case of error, the function
devm_regmap_init_i2c()returnsERR_PTR()and never returns NULL. The NULL test in the return value check should be replaced withIS_ERR().Fixes 6b149f3310a4 ("mfd: pm8008: Add driver for QCOM PM8008 PMIC")Signed-off-by Yang Yingliang <[email protected]>Reviewed-by Bjorn Andersson <[email protected]>
Quoted 6 lines
---
The previous patch link:
https://lore.kernel.org/lkml/[email protected]/--- drivers/mfd/qcom-pm8008.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Applied, thanks.
Signature · 1 line
Lee Jones [李琼斯]