dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: broonie@kernel.org, lgirdwood@gmail.com
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	airlied@linux.ie, robdclark@gmail.com, davidb@codeaurora.org,
	dri-devel@lists.freedesktop.org, Felipe Balbi <balbi@ti.com>
Subject: [PATCH] regulator: stub out devm_regulator_get_exclusive
Date: Fri, 24 Oct 2014 14:15:11 -0500	[thread overview]
Message-ID: <1414178111-19525-1-git-send-email-balbi@ti.com> (raw)

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

             reply	other threads:[~2014-10-24 19:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-24 19:15 Felipe Balbi [this message]
2014-10-24 19:20 ` [PATCH] regulator: stub out devm_regulator_get_exclusive 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1414178111-19525-1-git-send-email-balbi@ti.com \
    --to=balbi@ti.com \
    --cc=airlied@linux.ie \
    --cc=broonie@kernel.org \
    --cc=davidb@codeaurora.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robdclark@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox