summaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorKim, Milo <Milo.Kim@ti.com>2012-08-31 09:25:55 +0000
committerAnton Vorontsov <anton.vorontsov@linaro.org>2012-09-20 18:05:39 -0700
commitb59c93c0090d14556d988607e5bdb297d6e380a7 (patch)
tree7287159f6105ec4e334dd3138ea4d38523d0858a /drivers/power
parent91a696330ce4137eef7ad5712c9269a52dc261d4 (diff)
downloadop-kernel-dev-b59c93c0090d14556d988607e5bdb297d6e380a7.zip
op-kernel-dev-b59c93c0090d14556d988607e5bdb297d6e380a7.tar.gz
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 <milo.kim@ti.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/lp8727_charger.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/power/lp8727_charger.c b/drivers/power/lp8727_charger.c
index 880bb7b..2507b2b 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;
}
OpenPOWER on IntegriCloud