power: supply: ab8500_charger: Fix VBAT interval check
authorLinus Walleij <linus.walleij@linaro.org>
Sat, 29 Jan 2022 00:49:25 +0000 (01:49 +0100)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Fri, 11 Feb 2022 19:24:54 +0000 (20:24 +0100)
commit21ad180d0fdfb2ab6df0f19c7dedce829a9ed1ed
treef0d7f8f774ab7a4cd20a2090ddaeec68001bb9be
parent0f6dad11fdf765a2fc89ef86961efcfcf94b5d0a
power: supply: ab8500_charger: Fix VBAT interval check

When using USB charging, the AB8500 charger is periodically
checking VBAT for a threshold at 3.8V.

This crashes badly, as the class_for_each_device() was passed
the wrong argument. I think this has maybe worked by chance
in the past because of how the structs were arranged but it
is leading to crashes now.

Fix this up and also switch to using microvolts for the
voltages like the rest of the code.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/ab8500_charger.c