Skip to content

Commit 4529187

Browse files
sicelosre
authored andcommitted
power: supply: bq27xxx_battery: do not update cached flags prematurely
Commit 243f8ff ("power: supply: bq27xxx_battery: Notify also about status changes") intended to notify userspace when the status changes, based on the flags register. However, the cached state is updated too early, before the flags are tested for any changes. Remove the premature update. Fixes: 243f8ff ("power: supply: bq27xxx_battery: Notify also about status changes") Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com> Link: https://lore.kernel.org/r/20241125152945.47937-1-absicsz@gmail.com Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
1 parent a944cfd commit 4529187

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

drivers/power/supply/bq27xxx_battery.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1923,7 +1923,6 @@ static void bq27xxx_battery_update_unlocked(struct bq27xxx_device_info *di)
19231923
cache.flags = -1; /* read error */
19241924
if (cache.flags >= 0) {
19251925
cache.capacity = bq27xxx_battery_read_soc(di);
1926-
di->cache.flags = cache.flags;
19271926

19281927
/*
19291928
* On gauges with signed current reporting the current must be

0 commit comments

Comments
 (0)