diff options
author | Kim, Milo <Milo.Kim@ti.com> | 2012-08-31 05:25:55 -0400 |
---|---|---|
committer | Anton Vorontsov <anton.vorontsov@linaro.org> | 2012-09-20 21:05:39 -0400 |
commit | b59c93c0090d14556d988607e5bdb297d6e380a7 (patch) | |
tree | 7287159f6105ec4e334dd3138ea4d38523d0858a /drivers/power | |
parent | 91a696330ce4137eef7ad5712c9269a52dc261d4 (diff) |
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.c | 7 |
1 files changed, 4 insertions, 3 deletions
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, | |||
305 | { | 305 | { |
306 | struct lp8727_chg *pchg = dev_get_drvdata(psy->dev->parent); | 306 | struct lp8727_chg *pchg = dev_get_drvdata(psy->dev->parent); |
307 | 307 | ||
308 | if (psp == POWER_SUPPLY_PROP_ONLINE) | 308 | if (psp != POWER_SUPPLY_PROP_ONLINE) |
309 | val->intval = lp8727_is_charger_attached(psy->name, | 309 | return -EINVAL; |
310 | pchg->devid); | 310 | |
311 | val->intval = lp8727_is_charger_attached(psy->name, pchg->devid); | ||
311 | 312 | ||
312 | return 0; | 313 | return 0; |
313 | } | 314 | } |