Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

power: supply: hwmon: move interface to private header

The interface of power_supply_hwmon.c is only meant to be used by the
psy core. Remove it from the public header file and use the private one
instead.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20241017-power-supply-cleanups-v2-1-cb0f5deab088@weissschuh.net
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

authored by

Thomas Weißschuh and committed by
Sebastian Reichel
44fcc479 1e5335d0

+17 -13
+17
drivers/power/supply/power_supply.h
··· 44 44 static inline void power_supply_remove_triggers(struct power_supply *psy) {} 45 45 46 46 #endif /* CONFIG_LEDS_TRIGGERS */ 47 + 48 + #ifdef CONFIG_POWER_SUPPLY_HWMON 49 + 50 + int power_supply_add_hwmon_sysfs(struct power_supply *psy); 51 + void power_supply_remove_hwmon_sysfs(struct power_supply *psy); 52 + 53 + #else 54 + 55 + static inline int power_supply_add_hwmon_sysfs(struct power_supply *psy) 56 + { 57 + return 0; 58 + } 59 + 60 + static inline 61 + void power_supply_remove_hwmon_sysfs(struct power_supply *psy) {} 62 + 63 + #endif /* CONFIG_POWER_SUPPLY_HWMON */
-13
include/linux/power_supply.h
··· 937 937 return false; 938 938 } 939 939 940 - #ifdef CONFIG_POWER_SUPPLY_HWMON 941 - int power_supply_add_hwmon_sysfs(struct power_supply *psy); 942 - void power_supply_remove_hwmon_sysfs(struct power_supply *psy); 943 - #else 944 - static inline int power_supply_add_hwmon_sysfs(struct power_supply *psy) 945 - { 946 - return 0; 947 - } 948 - 949 - static inline 950 - void power_supply_remove_hwmon_sysfs(struct power_supply *psy) {} 951 - #endif 952 - 953 940 #ifdef CONFIG_SYSFS 954 941 ssize_t power_supply_charge_behaviour_show(struct device *dev, 955 942 unsigned int available_behaviours,