Skip to content

Commit

Permalink
regulator: act8865: fix ptr_ret.cocci warnings
Browse files Browse the repository at this point in the history
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: 2d09a79 ("regulator: act8865: Add support for act8600 charger")
CC: Maarten ter Huurne <maarten@treewalker.org>
Signed-off-by: kbuild test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20190724092236.witxtfmubun25l2t@1905cc33b6dd
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
kbuild test robot authored and Mark Brown committed Jul 25, 2019
1 parent a5f888c commit 1889c6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/regulator/act8865-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1889c6e

Please sign in to comment.