aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThomas Weißschuh <[email protected]>2022-01-08 16:31:58 +0100
committerHans de Goede <[email protected]>2022-01-08 16:56:01 +0100
commit3367d1bd738c01b2737eaab7d922bfe5f1a41f38 (patch)
treeaf61a90a39adb3232a722d231e93991ec22834ea /include
parent02fb09459435add44bb00191ce9b040c6b4f3aae (diff)
power: supply: Provide stubs for charge_behaviour helpers
When CONFIG_SYSFS is not enabled provide stubs for the helper functions to not break their callers. Fixes: 539b9c94ac83 ("power: supply: add helpers for charge_behaviour sysfs") Reported-by: kernel test robot <[email protected]> Signed-off-by: Thomas Weißschuh <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/linux/power_supply.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 71f0379c2af8..f6b9ed4630fa 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -553,6 +553,21 @@ ssize_t power_supply_charge_behaviour_show(struct device *dev,
char *buf);
int power_supply_charge_behaviour_parse(unsigned int available_behaviours, const char *buf);
+#else
+static inline
+ssize_t power_supply_charge_behaviour_show(struct device *dev,
+ unsigned int available_behaviours,
+ enum power_supply_charge_behaviour behaviour,
+ char *buf)
+{
+ return -EOPNOTSUPP;
+}
+
+static inline int power_supply_charge_behaviour_parse(unsigned int available_behaviours,
+ const char *buf)
+{
+ return -EOPNOTSUPP;
+}
#endif
#endif /* __LINUX_POWER_SUPPLY_H__ */