aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power/88pm860x_charger.c
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>2015-03-12 03:44:17 -0400
committerSebastian Reichel <sre@kernel.org>2015-03-13 18:15:54 -0400
commit52016ac072dac298fcd8764ccce46a1a7be18728 (patch)
treecd43dae11a6aa396de56713b576aed9fb60016d8 /drivers/power/88pm860x_charger.c
parent67273a1b421a12ef77bcf08b027d165f399054ae (diff)
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/88pm860x_charger.c')
-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 a7f32a5b2299..bf822aa00c14 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)
298 return -EINVAL; 298 return -EINVAL;
299 ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_VOLTAGE_NOW, 299 ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_VOLTAGE_NOW,
300 &data); 300 &data);
301 if (ret) 301 if (ret) {
302 power_supply_put(psy);
302 return ret; 303 return ret;
304 }
303 vbatt = data.intval / 1000; 305 vbatt = data.intval / 1000;
304 306
305 ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_PRESENT, &data); 307 ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_PRESENT, &data);
306 if (ret) 308 if (ret) {
309 power_supply_put(psy);
307 return ret; 310 return ret;
311 }
312 power_supply_put(psy);
308 313
309 mutex_lock(&info->lock); 314 mutex_lock(&info->lock);
310 info->present = data.intval; 315 info->present = data.intval;
@@ -447,6 +452,7 @@ static irqreturn_t pm860x_temp_handler(int irq, void *data)
447 452
448 set_charging_fsm(info); 453 set_charging_fsm(info);
449out: 454out:
455 power_supply_put(psy);
450 return IRQ_HANDLED; 456 return IRQ_HANDLED;
451} 457}
452 458
@@ -507,6 +513,7 @@ static irqreturn_t pm860x_done_handler(int irq, void *data)
507 513
508out: 514out:
509 mutex_unlock(&info->lock); 515 mutex_unlock(&info->lock);
516 power_supply_put(psy);
510 dev_dbg(info->dev, "%s, Allowed: %d\n", __func__, info->allowed); 517 dev_dbg(info->dev, "%s, Allowed: %d\n", __func__, info->allowed);
511 set_charging_fsm(info); 518 set_charging_fsm(info);
512 519