From: Kim, Milo Date: Fri, 31 Aug 2012 09:25:55 +0000 (+0000) Subject: lp8727_charger: Make lp8727_charger_get_propery() simpler X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b59c93c0090d14556d988607e5bdb297d6e380a7;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.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; }