aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/power_supply.h
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2024-12-10 22:55:49 +0100
committerSebastian Reichel <sebastian.reichel@collabora.com>2024-12-11 02:00:24 +0100
commit9029409d1a250da19f1086ab1113752411c5163d (patch)
treecbc2212717e8f78e06074d0c3896b8bd345fc508 /include/linux/power_supply.h
parentpower: supply: mm8013: use accessor for driver data (diff)
downloadwireguard-linux-9029409d1a250da19f1086ab1113752411c5163d.tar.xz
wireguard-linux-9029409d1a250da19f1086ab1113752411c5163d.zip
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>
Diffstat (limited to '')
-rw-r--r--include/linux/power_supply.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index b98106e1a90f..11d54270eaa9 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -882,6 +882,7 @@ extern int power_supply_powers(struct power_supply *psy, struct device *dev);
extern void *power_supply_get_drvdata(struct power_supply *psy);
extern int power_supply_for_each_device(void *data, int (*fn)(struct device *dev, void *data));
+extern int power_supply_for_each_psy(void *data, int (*fn)(struct power_supply *psy, void *data));
static inline bool power_supply_is_amp_property(enum power_supply_property psp)
{