summaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>2015-03-12 08:44:17 +0100
committerSebastian Reichel <sre@kernel.org>2015-03-13 23:15:54 +0100
commit52016ac072dac298fcd8764ccce46a1a7be18728 (patch)
treecd43dae11a6aa396de56713b576aed9fb60016d8 /drivers/power
parent67273a1b421a12ef77bcf08b027d165f399054ae (diff)
downloadop-kernel-dev-52016ac072dac298fcd8764ccce46a1a7be18728.zip
op-kernel-dev-52016ac072dac298fcd8764ccce46a1a7be18728.tar.gz
power_supply: 88pm860x_charger: Decrement the power supply's device reference counter
Use power_supply_put() to decrement the power supply's device reference counter. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Acked-by: Pavel Machek <pavel@ucw.cz> Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Reviewed-by: Sebastian Reichel <sre@kernel.org> Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/88pm860x_charger.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/power/88pm860x_charger.c b/drivers/power/88pm860x_charger.c
index a7f32a5b2..bf822aa 100644
--- a/drivers/power/88pm860x_charger.c
+++ b/drivers/power/88pm860x_charger.c
@@ -298,13 +298,18 @@ static int set_charging_fsm(struct pm860x_charger_info *info)
return -EINVAL;
ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_VOLTAGE_NOW,
&data);
- if (ret)
+ if (ret) {
+ power_supply_put(psy);
return ret;
+ }
vbatt = data.intval / 1000;
ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_PRESENT, &data);
- if (ret)
+ if (ret) {
+ power_supply_put(psy);
return ret;
+ }
+ power_supply_put(psy);
mutex_lock(&info->lock);
info->present = data.intval;
@@ -447,6 +452,7 @@ static irqreturn_t pm860x_temp_handler(int irq, void *data)
set_charging_fsm(info);
out:
+ power_supply_put(psy);
return IRQ_HANDLED;
}
@@ -507,6 +513,7 @@ static irqreturn_t pm860x_done_handler(int irq, void *data)
out:
mutex_unlock(&info->lock);
+ power_supply_put(psy);
dev_dbg(info->dev, "%s, Allowed: %d\n", __func__, info->allowed);
set_charging_fsm(info);
OpenPOWER on IntegriCloud