aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/regulator
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@codeaurora.org>2012-01-16 22:39:58 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-01-20 07:02:55 -0500
commit070b9079226d4f3e3e7c9f4eb81f2e02e7d99572 (patch)
tree312b92136c28a321624bb811b43e8b03a03660ec /include/linux/regulator
parentdcd6c92267155e70a94b3927bce681ce74b80d1f (diff)
regulator: Add devm_regulator_get()
Add a resource managed regulator_get() to simplify regulator usage in drivers. This allows driver authors to "get and forget" about their regulators by automatically calling regulator_put() when the driver is detached. [Fixed up a couple of coding style issues -- broonie] Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'include/linux/regulator')
-rw-r--r--include/linux/regulator/consumer.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index f2698a0edfc4..bcfe10658763 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -132,6 +132,8 @@ struct regulator_bulk_data {
132/* regulator get and put */ 132/* regulator get and put */
133struct regulator *__must_check regulator_get(struct device *dev, 133struct regulator *__must_check regulator_get(struct device *dev,
134 const char *id); 134 const char *id);
135struct regulator *__must_check devm_regulator_get(struct device *dev,
136 const char *id);
135struct regulator *__must_check regulator_get_exclusive(struct device *dev, 137struct regulator *__must_check regulator_get_exclusive(struct device *dev,
136 const char *id); 138 const char *id);
137void regulator_put(struct regulator *regulator); 139void regulator_put(struct regulator *regulator);
@@ -200,6 +202,13 @@ static inline struct regulator *__must_check regulator_get(struct device *dev,
200 */ 202 */
201 return NULL; 203 return NULL;
202} 204}
205
206static inline struct regulator *__must_check
207devm_regulator_get(struct device *dev, const char *id)
208{
209 return NULL;
210}
211
203static inline void regulator_put(struct regulator *regulator) 212static inline void regulator_put(struct regulator *regulator)
204{ 213{
205} 214}