[PATCH] regulator: act8865: fix ptr_ret.cocci warnings

From: kbuild test robot
Date: Wed Jul 24 2019 - 05:22:36 EST


drivers/regulator/act8865-regulator.c:447:8-14: WARNING: PTR_ERR_OR_ZERO can be used

Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

Fixes: 2d09a79bf637 ("regulator: act8865: Add support for act8600 charger")
CC: Maarten ter Huurne <maarten@xxxxxxxxxxxxxx>
Signed-off-by: kbuild test robot <lkp@xxxxxxxxx>
Link: 20190724092236.witxtfmubun25l2t@1905cc33b6dd">https://lore.kernel.org/r/20190724092236.witxtfmubun25l2t@1905cc33b6dd
Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
---
drivers/regulator/act8865-regulator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/act8865-regulator.c b/drivers/regulator/act8865-regulator.c
index b515e0785d67..6a90d3c7a452 100644
--- a/drivers/regulator/act8865-regulator.c
+++ b/drivers/regulator/act8865-regulator.c
@@ -465,7 +465,7 @@ static int act8600_charger_probe(struct device *dev, struct regmap *regmap)

charger = devm_power_supply_register(dev, &act8600_charger_desc, &cfg);

- return IS_ERR(charger) ? PTR_ERR(charger) : 0;
+ return PTR_ERR_OR_ZERO(charger);
}

static int act8865_pmic_probe(struct i2c_client *client,
--
2.20.1