]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
power: supply: bq27xxx_battery: do not update cached flags prematurely
authorSicelo A. Mhlongo <absicsz@gmail.com>
Mon, 25 Nov 2024 15:29:30 +0000 (17:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:39:20 +0000 (14:39 +0200)
commiteae034cdcee923875b005c412eedacef5e22be96
treebc0e9eacc708be98687aed2472f18e0d74aff762
parent005d8de09c71d98317da759b341395514e9e4068
power: supply: bq27xxx_battery: do not update cached flags prematurely

[ Upstream commit 45291874a762dbb12a619dc2efaf84598859007a ]

Commit 243f8ffc883a1 ("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: 243f8ffc883a1 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/power/supply/bq27xxx_battery.c