Skip to contentSkip to conversation

regulator: Add stub function for devm_regulator_get_exclusive

PATCH Superseded Axel Lin 2 participants 2 messages Aug 9, 2014 – Aug 11, 2014 Voltage and current regulator framework

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: Add stub function for devm_regulator_get_exclusive

Fix below build error when !CONFIG_REGULATOR.

CC drivers/gpu/drm/msm/hdmi/hdmi.o
drivers/gpu/drm/msm/hdmi/hdmi.c: In function 'hdmi_init':
drivers/gpu/drm/msm/hdmi/hdmi.c:126:3: error: implicit declaration of function 'devm_regulator_get_exclusive' [-Werror=implicit-function-declaration]

---
 include/linux/regulator/consumer.h | 6 ++++++
 1 file changed, 6 insertions(+)
include/linux/regulator/consumer.h +6 -0
index f8a8733..150d2f0 100644
@@ -266,6 +266,12 @@ regulator_get_exclusive(struct device *dev, const char *id)
 }
 
 static inline struct regulator *__must_check
+devm_regulator_get_exclusive(struct device *dev, const char *id)
+{
+	return NULL;
+}
+
+static inline struct regulator *__must_check
 regulator_get_optional(struct device *dev, const char *id)
 {
 	return ERR_PTR(-ENODEV);
Signature · 1 line
1.9.1
maintainer
#1 lore raw

include/linux/regulator/consumer.h regulator_get_exclusive(struct device *dev, const char *id) · line 274

Quoted 7 lines · Axel Lin

static inline struct regulator *__must_check

include/linux/regulator/consumer.h +6 -0
+devm_regulator_get_exclusive(struct device *dev, const char *id)
+{
+	return NULL;
+}
+
+static inline struct regulator *__must_check

This should be returning an error pointer, something wanting exclusive control of a regulator would normally expect to have an actual regulator and want to do things with it and so probably won't work well with a dummy regulator.