From: Kim, Milo Date: Fri, 31 Aug 2012 09:25:55 +0000 (+0000) Subject: lp8727_charger: Make lp8727_charger_get_propery() simpler X-Git-Tag: firefly_0821_release~3680^2~1907^2~12 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b59c93c0090d14556d988607e5bdb297d6e380a7;p=firefly-linux-kernel-4.4.55.git 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: Milo(Woogyom) Kim Signed-off-by: Anton Vorontsov --- diff --git a/drivers/power/lp8727_charger.c b/drivers/power/lp8727_charger.c index 880bb7b98233..2507b2bb9df2 100644 --- a/drivers/power/lp8727_charger.c +++ b/drivers/power/lp8727_charger.c @@ -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; }