linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regulator: Add stub function for devm_regulator_get_exclusive
@ 2014-08-09  4:15 Axel Lin
  2014-08-11 18:58 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2014-08-09  4:15 UTC (permalink / raw)
  To: Mark Brown; +Cc: Liam Girdwood, linux-kernel

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]

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 include/linux/regulator/consumer.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index f8a8733..150d2f0 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -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);
-- 
1.9.1




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] regulator: Add stub function for devm_regulator_get_exclusive
  2014-08-09  4:15 [PATCH] regulator: Add stub function for devm_regulator_get_exclusive Axel Lin
@ 2014-08-11 18:58 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2014-08-11 18:58 UTC (permalink / raw)
  To: Axel Lin; +Cc: Liam Girdwood, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 485 bytes --]

On Sat, Aug 09, 2014 at 12:15:07PM +0800, Axel Lin wrote:

>  static inline struct regulator *__must_check
> +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.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-11 18:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-09  4:15 [PATCH] regulator: Add stub function for devm_regulator_get_exclusive Axel Lin
2014-08-11 18:58 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).