Skip to contentSkip to conversation

regulator: Add empty devm_regulator_free for !CONFIG_REGULATOR

PATCH In review Axel Lin 2 participants 3 messages Jan 29, 2012 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: Add empty devm_regulator_free for !CONFIG_REGULATOR

So we don't have to add #ifdef CONFIG_REGULATOR guards for all the callers of devm_regulator_free.

---
 include/linux/regulator/consumer.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
include/linux/regulator/consumer.h +4 -0
index cef8f04..ad4eae8 100644
@@ -216,6 +216,10 @@ static inline void regulator_put(struct regulator *regulator)
 {
 }
 
+static inline void devm_regulator_free(struct regulator *regulator)
+{
+}
+
 static inline int regulator_enable(struct regulator *regulator)
 {
 	return 0;
Signature · 1 line
1.7.5.4
author
#1 lore raw

include/linux/regulator/consumer.h static inline void regulator_put(struct regulator *regulator) · line 222

Quoted 4 lines
include/linux/regulator/consumer.h +4 -0
+static inline void devm_regulator_free(struct regulator *regulator)
+{
+}
+

Oh wait.
I found commit d5ad34f7cb "regulator: Implement devm_regulator_free()" has declared devm_regulator_free in include/linux/regulator/consumer.h But it actually implements devm_regulator_put instead of devm_regulator_free.

Mark, I guess what you want is to declare devm_regulator_put instead of devm_regulator_free
in consumer.h.

Regards,
Axel

Quoted 8 lines

 static inline int regulator_enable(struct regulator *regulator) {
       return 0;
--
1.7.5.4

#2 lore raw
Quoted 3 lines · Axel Lin

Mark, I guess what you want is to declare devm_regulator_put instead of devm_regulator_free
in consumer.h.

Yes, indeed - put to match the get.