public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] regulator: Add stub for devm_regulator_get_exclusive
@ 2014-08-12  1:37 Axel Lin
  2014-08-12 21:55 ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Axel Lin @ 2014-08-12  1:37 UTC (permalink / raw)
  To: Mark Brown; +Cc: Liam Girdwood, linux-kernel@vger.kernel.org

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]

Also makes regulator_get_exclusive and devm_regulator_get_exclusive stub
functions return error pointer.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 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 f8a8733..66473e3 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -262,7 +262,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] 4+ messages in thread

* Re: [PATCH v2] regulator: Add stub for devm_regulator_get_exclusive
  2014-08-12  1:37 [PATCH v2] regulator: Add stub for devm_regulator_get_exclusive Axel Lin
@ 2014-08-12 21:55 ` Mark Brown
  2014-08-16 13:30   ` Axel Lin
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2014-08-12 21:55 UTC (permalink / raw)
  To: Axel Lin; +Cc: Liam Girdwood, Rob Clark, linux-kernel@vger.kernel.org

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

On Tue, Aug 12, 2014 at 09:37:09AM +0800, Axel Lin wrote:
> 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]

So, I just looked at that driver - it errors out on probe without the
regualtor.  Are you sure the fix isn't to add a dependency on the
regulator API or convert it back to using normal regulator gets (it was
converted without comment as part of a DT conversion), or indeed to
using the bulk regulator API.  It looks awfully like the driver is just
open coding devm_regulator_bulk_get() and friends.

There is no explanation at all in either the changelog or the code for
why the driver is asking for exclusive regulators.

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

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

* Re: [PATCH v2] regulator: Add stub for devm_regulator_get_exclusive
  2014-08-12 21:55 ` Mark Brown
@ 2014-08-16 13:30   ` Axel Lin
  2014-08-16 22:00     ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Axel Lin @ 2014-08-16 13:30 UTC (permalink / raw)
  To: Mark Brown; +Cc: Liam Girdwood, Rob Clark, linux-kernel@vger.kernel.org

2014-08-13 5:55 GMT+08:00 Mark Brown <broonie@kernel.org>:
> On Tue, Aug 12, 2014 at 09:37:09AM +0800, Axel Lin wrote:
>> 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]
>
> So, I just looked at that driver - it errors out on probe without the
> regualtor.  Are you sure the fix isn't to add a dependency on the
> regulator API or convert it back to using normal regulator gets (it was
> converted without comment as part of a DT conversion), or indeed to
> using the bulk regulator API.  It looks awfully like the driver is just
> open coding devm_regulator_bulk_get() and friends.
>
> There is no explanation at all in either the changelog or the code for
> why the driver is asking for exclusive regulators.
Hi Rob,
Any feedback about Mark's comment?

Hi Mark,
Even though not for this build fix, I think the patch is still good.
Should I remove the build error message and resend the patch to you?

Regards,
Axel

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

* Re: [PATCH v2] regulator: Add stub for devm_regulator_get_exclusive
  2014-08-16 13:30   ` Axel Lin
@ 2014-08-16 22:00     ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2014-08-16 22:00 UTC (permalink / raw)
  To: Axel Lin; +Cc: Liam Girdwood, Rob Clark, linux-kernel@vger.kernel.org

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

On Sat, Aug 16, 2014 at 09:30:26PM +0800, Axel Lin wrote:

> Hi Mark,
> Even though not for this build fix, I think the patch is still good.
> Should I remove the build error message and resend the patch to you?

It's fine as-is, I was partly holding off because of -rc1 and partly
holding off to see what Rob said about the usage.  I'll probably apply
it at some point if I don't hear anythihing back but I really want to
either understand the usage or see it fixed.

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

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

end of thread, other threads:[~2014-08-16 22:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-12  1:37 [PATCH v2] regulator: Add stub for devm_regulator_get_exclusive Axel Lin
2014-08-12 21:55 ` Mark Brown
2014-08-16 13:30   ` Axel Lin
2014-08-16 22:00     ` Mark Brown

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