Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b59c93c0 authored by Kim, Milo's avatar Kim, Milo Committed by Anton Vorontsov
Browse files

lp8727_charger: Make lp8727_charger_get_propery() simpler



Charger has only one valid property - ONLINE. If the property is not
ONLINE, then just return quickly.

Signed-off-by: default avatarMilo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: default avatarAnton Vorontsov <anton.vorontsov@linaro.org>
parent 91a69633
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -305,9 +305,10 @@ static int lp8727_charger_get_property(struct power_supply *psy,
{
	struct lp8727_chg *pchg = dev_get_drvdata(psy->dev->parent);

	if (psp == POWER_SUPPLY_PROP_ONLINE)
		val->intval = lp8727_is_charger_attached(psy->name,
							 pchg->devid);
	if (psp != POWER_SUPPLY_PROP_ONLINE)
		return -EINVAL;

	val->intval = lp8727_is_charger_attached(psy->name, pchg->devid);

	return 0;
}