mirror of
https://github.com/torvalds/linux.git
synced 2026-05-22 06:01:53 +02:00
power: supply: bq27xxx_battery: do not update cached flags prematurely
Commit243f8ffc88("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:243f8ffc88("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>
This commit is contained in:
parent
a944cfd799
commit
45291874a7
|
|
@ -1923,7 +1923,6 @@ static void bq27xxx_battery_update_unlocked(struct bq27xxx_device_info *di)
|
|||
cache.flags = -1; /* read error */
|
||||
if (cache.flags >= 0) {
|
||||
cache.capacity = bq27xxx_battery_read_soc(di);
|
||||
di->cache.flags = cache.flags;
|
||||
|
||||
/*
|
||||
* On gauges with signed current reporting the current must be
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user