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

From: kbuild test robot
Date: Wed Jul 24 2019 - 05:23:29 EST


From: kbuild test robot <lkp@xxxxxxxxx>

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>
---

tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/next/linux-next.git master
head: 9e6dfe8045f85f9b5aade47e4192482927e2791a
commit: 2d09a79bf637f91d1bbfcfd4520e3639dd15897c [2115/2398] regulator: act8865: Add support for act8600 charger

act8865-regulator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/regulator/act8865-regulator.c
+++ b/drivers/regulator/act8865-regulator.c
@@ -444,7 +444,7 @@ static int act8600_charger_probe(struct

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,