]> www.infradead.org Git - users/jedix/linux-maple.git/commit
power: supply: core: introduce power_supply_for_each_psy()
authorThomas Weißschuh <linux@weissschuh.net>
Tue, 10 Dec 2024 21:55:49 +0000 (22:55 +0100)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Wed, 11 Dec 2024 01:00:24 +0000 (02:00 +0100)
commit9029409d1a250da19f1086ab1113752411c5163d
treecbc2212717e8f78e06074d0c3896b8bd345fc508
parente959fdb1cd4dccd37225cac654901a862c52e0c5
power: supply: core: introduce power_supply_for_each_psy()

All existing callers of power_supply_for_each_device() want to iterate
over 'struct power_supply', not 'struct device'.
The power_supply_for_each_device() forces each caller to duplicate the
logic to go from one to the other.
Introduce power_supply_for_each_psy() to simplify the callers.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20241210-power-supply-dev_to_psy-v2-2-9d8c9d24cfe4@weissschuh.net
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/power_supply_core.c
include/linux/power_supply.h