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

power: supply: core: unexport power_supply_property_is_writeable()

Since commit ("power: supply: Drop use_cnt check from power_supply_property_is_writeable()"),
this function does not check use_cnt anymore, making it unsuitable for
general usage. As it is only used by the psy core anyways, remove it
from the public header and unexport it to avoid misusage.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20241005-power-supply-cleanups-v1-2-45303b2d0a4d@weissschuh.net
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

authored by

Thomas Weißschuh and committed by
Sebastian Reichel
cf70da29 bd3ee57b

+4 -3
+3
drivers/power/supply/power_supply.h
··· 13 13 struct device_type; 14 14 struct power_supply; 15 15 16 + extern int power_supply_property_is_writeable(struct power_supply *psy, 17 + enum power_supply_property psp); 18 + 16 19 #ifdef CONFIG_SYSFS 17 20 18 21 extern void power_supply_init_attrs(void);
-1
drivers/power/supply/power_supply_core.c
··· 1231 1231 { 1232 1232 return psy->desc->property_is_writeable && psy->desc->property_is_writeable(psy, psp); 1233 1233 } 1234 - EXPORT_SYMBOL_GPL(power_supply_property_is_writeable); 1235 1234 1236 1235 void power_supply_external_power_changed(struct power_supply *psy) 1237 1236 {
+1
drivers/power/supply/power_supply_hwmon.c
··· 7 7 #include <linux/hwmon.h> 8 8 #include <linux/power_supply.h> 9 9 #include <linux/slab.h> 10 + #include "power_supply.h" 10 11 11 12 struct power_supply_hwmon { 12 13 struct power_supply *psy;
-2
include/linux/power_supply.h
··· 865 865 const union power_supply_propval *val) 866 866 { return 0; } 867 867 #endif 868 - extern int power_supply_property_is_writeable(struct power_supply *psy, 869 - enum power_supply_property psp); 870 868 extern void power_supply_external_power_changed(struct power_supply *psy); 871 869 872 870 extern struct power_supply *__must_check