diff options
author | Anton Vorontsov <anton.vorontsov@linaro.org> | 2012-03-15 21:01:28 +0400 |
---|---|---|
committer | Anton Vorontsov <anton.vorontsov@linaro.org> | 2012-03-26 20:41:20 +0400 |
commit | df58c04c9f4182f979973a06ce40b44a5b84aeb5 (patch) | |
tree | 8957ee174e8ea20ce0ef09567904c269a18dd602 /drivers/power | |
parent | bb2a95c2d2450be1ac942adf6815375f620b7015 (diff) | |
download | op-kernel-dev-df58c04c9f4182f979973a06ce40b44a5b84aeb5.zip op-kernel-dev-df58c04c9f4182f979973a06ce40b44a5b84aeb5.tar.gz |
charger-manager: Simplify charger_get_property(), get rid of a warning
This patch fixes the following warning and makes the code a little
bit more simpler:
CC drivers/power/charger-manager.o
charger-manager.c: In function 'charger_get_property':
charger-manager.c:429:15: warning: 'i' may be used uninitialized in this function [-Wuninitialized]
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/charger-manager.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/power/charger-manager.c b/drivers/power/charger-manager.c index e610e6b..9eca9f1 100644 --- a/drivers/power/charger-manager.c +++ b/drivers/power/charger-manager.c @@ -399,7 +399,8 @@ static int charger_get_property(struct power_supply *psy, struct charger_manager *cm = container_of(psy, struct charger_manager, charger_psy); struct charger_desc *desc = cm->desc; - int i, ret = 0, uV; + int ret = 0; + int uV; switch (psp) { case POWER_SUPPLY_PROP_STATUS: @@ -425,8 +426,7 @@ static int charger_get_property(struct power_supply *psy, val->intval = 0; break; case POWER_SUPPLY_PROP_VOLTAGE_NOW: - ret = get_batt_uV(cm, &i); - val->intval = i; + ret = get_batt_uV(cm, &val->intval); break; case POWER_SUPPLY_PROP_CURRENT_NOW: ret = cm->fuel_gauge->get_property(cm->fuel_gauge, |