regulator: Add empty devm_regulator_free for !CONFIG_REGULATOR
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
@@ -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
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
Quoted 3 lines · Axel Lin
Mark, I guess what you want is to declare
devm_regulator_putinstead ofdevm_regulator_free
inconsumer.h.
Yes, indeed - put to match the get.