regulator: Add stub function for devm_regulator_get_exclusive
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.odrivers/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]
Signed-off-by Axel Lin <[email protected]>
--- include/linux/regulator/consumer.h | 6 ++++++ 1 file changed, 6 insertions(+)
include/linux/regulator/consumer.h +6 -0
@@ -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
Mark Brown
maintainerinclude/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_checkinclude/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.