Commit 52016ac0 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Sebastian Reichel

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: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Reviewed-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Reviewed-by: default avatarSebastian Reichel <sre@kernel.org>
Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
parent 67273a1b
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment