power: supply: core: add power_supply_for_each_device()
authorSebastian Reichel <sebastian.reichel@collabora.com>
Fri, 1 Mar 2024 22:58:26 +0000 (23:58 +0100)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Tue, 5 Mar 2024 23:21:34 +0000 (00:21 +0100)
commit68ade0976df7979eac5f1d46320ff798f5043af6
treebbd9ce6c1190b841f435bf186e0ec399a33529ae
parent71c2cc5cbf686c2397f43cbcb51a31589bdcee7b
power: supply: core: add power_supply_for_each_device()

Introduce power_supply_for_each_device(), which is a wrapper
for class_for_each_device() using the power_supply_class and
going through all devices.

This allows making the power_supply_class itself a local
variable, so that drivers cannot mess with it and simplifies
the code slightly.

Reviewed-by: Ricardo B. Marliere <ricardo@marliere.net>
Link: https://lore.kernel.org/r/20240301-psy-class-cleanup-v1-1-aebe8c4b6b08@collabora.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/ab8500_btemp.c
drivers/power/supply/ab8500_chargalg.c
drivers/power/supply/ab8500_charger.c
drivers/power/supply/ab8500_fg.c
drivers/power/supply/apm_power.c
drivers/power/supply/power_supply_core.c
include/linux/power_supply.h