diff options
author | Hans de Goede <hdegoede@redhat.com> | 2015-06-09 23:37:56 +0200 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2015-06-10 16:15:54 +0200 |
commit | fe27e1dfe9962b07215ee01445926306ddbb7c25 (patch) | |
tree | b0e05cfc8302404ba84e0b4c3d270ff4b4d1b762 /include/linux/power_supply.h | |
parent | a6e6b63ee2798f18e0e786feb407cc7846077ea3 (diff) |
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>
Diffstat (limited to 'include/linux/power_supply.h')
-rw-r--r-- | include/linux/power_supply.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 0395bcb18ddb..ef9f1592185d 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -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); |