Commit 97456a24 authored by Tony Lindgren's avatar Tony Lindgren Committed by Sebastian Reichel

power: supply: cpcap-battery: Fix missing power_supply_put()

Fix missing power_supply_put().

Cc: Arthur Demchenkov <spinal.by@gmail.com>
Cc: Carl Philipp Klemm <philipp@uvos.xyz>
Cc: Merlijn Wajer <merlijn@wizzup.org>
Cc: Pavel Machek <pavel@ucw.cz>
Fixes: 8b0134cc ("power: supply: cpcap-battery: Fix handling of lowered charger voltage")
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 4bff91bb
......@@ -568,17 +568,21 @@ static int cpcap_battery_update_charger(struct cpcap_battery_ddata *ddata,
POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE,
&prop);
if (error)
return error;
goto out_put;
/* Allow charger const voltage lower than battery const voltage */
if (const_charge_voltage > prop.intval)
return 0;
goto out_put;
val.intval = const_charge_voltage;
return power_supply_set_property(charger,
error = power_supply_set_property(charger,
POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE,
&val);
out_put:
power_supply_put(charger);
return error;
}
static int cpcap_battery_set_property(struct power_supply *psy,
......
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