summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSebastian Reichel <sebastian.reichel@collabora.com>2024-03-01 23:58:26 +0100
committerSebastian Reichel <sebastian.reichel@collabora.com>2024-03-06 00:21:34 +0100
commit68ade0976df7979eac5f1d46320ff798f5043af6 (patch)
treebbd9ce6c1190b841f435bf186e0ec399a33529ae /include
parent71c2cc5cbf686c2397f43cbcb51a31589bdcee7b (diff)
downloadlinux-stable-68ade0976df7979eac5f1d46320ff798f5043af6.tar.gz
linux-stable-68ade0976df7979eac5f1d46320ff798f5043af6.tar.bz2
linux-stable-68ade0976df7979eac5f1d46320ff798f5043af6.zip
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 'include')
-rw-r--r--include/linux/power_supply.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 514f652de64d..92dd205774ec 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -894,8 +894,7 @@ extern int power_supply_powers(struct power_supply *psy, struct device *dev);
#define to_power_supply(device) container_of(device, struct power_supply, dev)
extern void *power_supply_get_drvdata(struct power_supply *psy);
-/* For APM emulation, think legacy userspace. */
-extern const struct class power_supply_class;
+extern int power_supply_for_each_device(void *data, int (*fn)(struct device *dev, void *data));
static inline bool power_supply_is_amp_property(enum power_supply_property psp)
{