public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: stub out devm_regulator_get_exclusive
@ 2014-10-24 19:15 Felipe Balbi
  2014-10-24 19:20 ` Felipe Balbi
  2014-10-24 20:11 ` Mark Brown
  0 siblings, 2 replies; 9+ messages in thread
From: Felipe Balbi @ 2014-10-24 19:15 UTC (permalink / raw)
  To: broonie, lgirdwood
  Cc: Linux Kernel Mailing List, airlied, robdclark, davidb, dri-devel,
	Felipe Balbi

If we don't stup that call out, we will have
build failures for any drivers using that function
when .config happens to have CONFIG_REGULATOR=n.

One such case below, found with randconfig

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]
  mdp4_kms->vdd = devm_regulator_get_exclusive(&pdev->dev, "vdd");
  ^
drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c:384:16: error: assignment makes \
	pointer from integer without a cast [-Werror]
  mdp4_kms->vdd = devm_regulator_get_exclusive(&pdev->dev, "vdd");
                ^
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 include/linux/regulator/consumer.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index d347c80..ff61f3b 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -291,6 +291,11 @@ regulator_get_optional(struct device *dev, const char *id)
 	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
 devm_regulator_get_optional(struct device *dev, const char *id)
-- 
2.1.0.GIT


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

end of thread, other threads:[~2014-10-25 21:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-24 19:15 [PATCH] regulator: stub out devm_regulator_get_exclusive Felipe Balbi
2014-10-24 19:20 ` Felipe Balbi
2014-10-24 20:11 ` Mark Brown
2014-10-24 20:18   ` Felipe Balbi
2014-10-24 20:58     ` Mark Brown
2014-10-24 20:36   ` Rob Clark
2014-10-24 21:18     ` Mark Brown
2014-10-24 21:57       ` Rob Clark
2014-10-25  9:46         ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox