diff options
author | Sebastian Reichel <sebastian.reichel@collabora.com> | 2024-03-02 01:58:26 +0300 |
---|---|---|
committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2024-03-06 02:21:34 +0300 |
commit | 68ade0976df7979eac5f1d46320ff798f5043af6 (patch) | |
tree | bbd9ce6c1190b841f435bf186e0ec399a33529ae /drivers/power/supply/ab8500_fg.c | |
parent | 71c2cc5cbf686c2397f43cbcb51a31589bdcee7b (diff) | |
download | linux-68ade0976df7979eac5f1d46320ff798f5043af6.tar.xz |
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>
Diffstat (limited to 'drivers/power/supply/ab8500_fg.c')
-rw-r--r-- | drivers/power/supply/ab8500_fg.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/power/supply/ab8500_fg.c b/drivers/power/supply/ab8500_fg.c index e49e704023e1..2ccaf6116c09 100644 --- a/drivers/power/supply/ab8500_fg.c +++ b/drivers/power/supply/ab8500_fg.c @@ -2407,8 +2407,7 @@ out: */ static void ab8500_fg_external_power_changed(struct power_supply *psy) { - class_for_each_device(&power_supply_class, NULL, psy, - ab8500_fg_get_ext_psy_data); + power_supply_for_each_device(psy, ab8500_fg_get_ext_psy_data); } /** |