summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2015-06-09 23:37:56 +0200
committerSebastian Reichel <sre@kernel.org>2015-06-10 16:15:54 +0200
commitfe27e1dfe9962b07215ee01445926306ddbb7c25 (patch)
treeb0e05cfc8302404ba84e0b4c3d270ff4b4d1b762 /include
parenta6e6b63ee2798f18e0e786feb407cc7846077ea3 (diff)
downloadlinux-fe27e1dfe9962b07215ee01445926306ddbb7c25.tar.gz
linux-fe27e1dfe9962b07215ee01445926306ddbb7c25.tar.bz2
linux-fe27e1dfe9962b07215ee01445926306ddbb7c25.zip
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')
-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);