* [PATCH RESEND] regulator: Add stub for devm_regulator_get_exclusive
@ 2014-10-09 11:14 Axel Lin
2014-10-13 11:04 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2014-10-09 11:14 UTC (permalink / raw)
To: Mark Brown; +Cc: Liam Girdwood, linux-kernel@vger.kernel.org
Also makes regulator_get_exclusive and devm_regulator_get_exclusive stub
functions return error pointer.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
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(-)
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index d347c80..f124c08 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -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
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH RESEND] regulator: Add stub for devm_regulator_get_exclusive
2014-10-09 11:14 [PATCH RESEND] regulator: Add stub for devm_regulator_get_exclusive Axel Lin
@ 2014-10-13 11:04 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2014-10-13 11:04 UTC (permalink / raw)
To: Axel Lin
Cc: Liam Girdwood, linux-kernel@vger.kernel.org, David Airlie,
Rob Clark, David Brown, dri-devel
[-- Attachment #1: Type: text/plain, Size: 1319 bytes --]
On Thu, Oct 09, 2014 at 07:14:18PM +0800, Axel Lin wrote:
> Also makes regulator_get_exclusive and devm_regulator_get_exclusive stub
> functions return error pointer.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> 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]
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?
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-10-13 11:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-09 11:14 [PATCH RESEND] regulator: Add stub for devm_regulator_get_exclusive Axel Lin
2014-10-13 11:04 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox