提交 b59c93c0 编写于 作者: K Kim, Milo 提交者: Anton Vorontsov

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: NMilo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
上级 91a69633
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册