mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 15:27:29 +00:00
power: Add devm_power_supply_get_by_phandle() helper function
This commit adds a resource-managed version of the power_supply_get_by_phandle() function. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
This commit is contained in:
parent
a6e6b63ee2
commit
fe27e1dfe9
2 changed files with 44 additions and 0 deletions
|
@ -292,10 +292,15 @@ extern void power_supply_put(struct power_supply *psy);
|
|||
#ifdef CONFIG_OF
|
||||
extern struct power_supply *power_supply_get_by_phandle(struct device_node *np,
|
||||
const char *property);
|
||||
extern struct power_supply *devm_power_supply_get_by_phandle(
|
||||
struct device *dev, const char *property);
|
||||
#else /* !CONFIG_OF */
|
||||
static inline struct power_supply *
|
||||
power_supply_get_by_phandle(struct device_node *np, const char *property)
|
||||
{ return NULL; }
|
||||
static inline struct power_supply *
|
||||
devm_power_supply_get_by_phandle(struct device *dev, const char *property)
|
||||
{ return NULL; }
|
||||
#endif /* CONFIG_OF */
|
||||
extern void power_supply_changed(struct power_supply *psy);
|
||||
extern int power_supply_am_i_supplied(struct power_supply *psy);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue