summaryrefslogtreecommitdiff
path: root/include/linux/power_supply.h
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2015-06-10 00:37:56 +0300
committerSebastian Reichel <sre@kernel.org>2015-06-10 17:15:54 +0300
commitfe27e1dfe9962b07215ee01445926306ddbb7c25 (patch)
treeb0e05cfc8302404ba84e0b4c3d270ff4b4d1b762 /include/linux/power_supply.h
parenta6e6b63ee2798f18e0e786feb407cc7846077ea3 (diff)
downloadlinux-fe27e1dfe9962b07215ee01445926306ddbb7c25.tar.xz
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.h5
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);