diff options
author | Kim, Milo <Milo.Kim@ti.com> | 2012-08-31 11:25:55 +0200 |
---|---|---|
committer | Anton Vorontsov <anton.vorontsov@linaro.org> | 2012-09-21 03:05:39 +0200 |
commit | b59c93c0090d14556d988607e5bdb297d6e380a7 (patch) | |
tree | 7287159f6105ec4e334dd3138ea4d38523d0858a /drivers/power | |
parent | lp8727_charger: Make lp8727_ctrl_switch() inline (diff) | |
download | linux-b59c93c0090d14556d988607e5bdb297d6e380a7.tar.xz linux-b59c93c0090d14556d988607e5bdb297d6e380a7.zip |
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, { 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; } |