Skip to content

Commit

Permalink
power: supply: hwmon: move interface to private header
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Weißschuh authored and Sebastian Reichel committed Oct 17, 2024
1 parent 1e5335d commit 44fcc47
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
17 changes: 17 additions & 0 deletions drivers/power/supply/power_supply.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,20 @@ static inline int power_supply_create_triggers(struct power_supply *psy)
static inline void power_supply_remove_triggers(struct power_supply *psy) {}

#endif /* CONFIG_LEDS_TRIGGERS */

#ifdef CONFIG_POWER_SUPPLY_HWMON

int power_supply_add_hwmon_sysfs(struct power_supply *psy);
void power_supply_remove_hwmon_sysfs(struct power_supply *psy);

#else

static inline int power_supply_add_hwmon_sysfs(struct power_supply *psy)
{
return 0;
}

static inline
void power_supply_remove_hwmon_sysfs(struct power_supply *psy) {}

#endif /* CONFIG_POWER_SUPPLY_HWMON */
13 changes: 0 additions & 13 deletions include/linux/power_supply.h
Original file line number Diff line number Diff line change
Expand Up @@ -937,19 +937,6 @@ static inline bool power_supply_is_watt_property(enum power_supply_property psp)
return false;
}

#ifdef CONFIG_POWER_SUPPLY_HWMON
int power_supply_add_hwmon_sysfs(struct power_supply *psy);
void power_supply_remove_hwmon_sysfs(struct power_supply *psy);
#else
static inline int power_supply_add_hwmon_sysfs(struct power_supply *psy)
{
return 0;
}

static inline
void power_supply_remove_hwmon_sysfs(struct power_supply *psy) {}
#endif

#ifdef CONFIG_SYSFS
ssize_t power_supply_charge_behaviour_show(struct device *dev,
unsigned int available_behaviours,
Expand Down

0 comments on commit 44fcc47

Please sign in to comment.