Skip to contentSkip to conversation

regulator: Add stub for devm_regulator_get_exclusive

PATCH RESEND In review Axel Lin 2 participants 2 messages Oct 9, 2014 – Oct 13, 2014 Voltage and current regulator framework

v1 of 2 In review Latest is v2 →

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH RESEND 1/1 regulator: Add stub for devm_regulator_get_exclusive

Also makes regulator_get_exclusive and devm_regulator_get_exclusive stub functions return error pointer.

---
Hi Mark,
I hit below build error and then found this patch is still not yet upstream. So here is a resend.

CC [M] drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.o
drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c: In function 'mdp4_kms_init':
drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c:384:2: error: implicit declaration of function 'devm_regulator_get_exclusive' [-Werror=implicit-function-declaration] drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c:384:16: error: assignment makes pointer from integer without a cast [-Werror]
cc1: all warnings being treated as errors
make[4]: *** [drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.o] Error 1
make[3]: *** [drivers/gpu/drm/msm] Error 2
make[2]: *** [drivers/gpu/drm] Error 2
make[1]: *** [drivers/gpu] Error 2
make: *** [drivers] Error 2

 include/linux/regulator/consumer.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
include/linux/regulator/consumer.h +7 -1
index d347c80..f124c08 100644
@@ -282,7 +282,13 @@ devm_regulator_get(struct device *dev, const char *id)
 static inline struct regulator *__must_check
 regulator_get_exclusive(struct device *dev, const char *id)
 {
-	return NULL;
+	return ERR_PTR(-ENODEV);
+}
+
+static inline struct regulator *__must_check
+devm_regulator_get_exclusive(struct device *dev, const char *id)
+{
+	return ERR_PTR(-ENODEV);
 }
 
 static inline struct regulator *__must_check
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 9 lines · Axel Lin

Also makes regulator_get_exclusive and devm_regulator_get_exclusive stub functions return error pointer.

---
Hi Mark,
I hit below build error and then found this patch is still not yet upstream. So here is a resend.

Quoted 4 lines

CC [M] drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.o
drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c: In function 'mdp4_kms_init':
drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c:384:2: error: implicit declaration of function 'devm_regulator_get_exclusive' [-Werror=implicit-function-declaration] drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c:384:16: error: assignment makes pointer from integer without a cast [-Werror]

To be honest the fact that you're hitting bugs with this is kind of making me think that this is a good idea.

Looking at the code in the driver there are rather a lot of problems - the whole way the errors are ignored in the probe function is concerning and most likely buggy at least with deferred probe. For the immediate problem with using regulator_get_exclusive() I can't understand why it's being used at all. In general all the regulator usage in the driver is atypical and doesn't look idiomatic - do we understand what's going on here?