diff options
| author | Sebastian Reichel <sebastian.reichel@collabora.com> | 2026-07-26 01:38:07 +0200 |
|---|---|---|
| committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2026-07-26 01:38:07 +0200 |
| commit | df55823b98feda7190aae7c8b186b9b66b8730dc (patch) | |
| tree | 72c0836c78c9c912059d79264a439e81a07ed146 /include/linux | |
| parent | 13cf94703737b4b9a6826987b46020df0642b1e0 (diff) | |
| parent | 0962125d9001077e91bc90656245f009e3c6c129 (diff) | |
Merge tag 'ib-psy-array-helpers-for-v7.3-signed' into psy-next
Immutable branch for battery array helpers to be used by the
USB-C state machine.
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/power_supply.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 9b4030802d78..d9c8cce9faad 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -811,11 +811,26 @@ extern int power_supply_reg_notifier(struct notifier_block *nb); extern void power_supply_unreg_notifier(struct notifier_block *nb); #if IS_ENABLED(CONFIG_POWER_SUPPLY) extern struct power_supply *power_supply_get_by_name(const char *name); +extern int __must_check power_supply_get_system_batteries(struct device *dev, + struct power_supply ***psys); +extern void power_supply_put_system_batteries(struct power_supply **psys, int count); extern void power_supply_put(struct power_supply *psy); #else static inline void power_supply_put(struct power_supply *psy) {} static inline struct power_supply *power_supply_get_by_name(const char *name) { return NULL; } +static inline int __must_check power_supply_get_system_batteries(struct device *dev, + struct power_supply ***psys) +{ + if (psys) + *psys = NULL; + return 0; +} + +static inline void power_supply_put_system_batteries(struct power_supply **psys, + int count) +{ +} #endif extern struct power_supply *power_supply_get_by_reference(struct fwnode_handle *fwnode, const char *property); |
