* [PATCH] regulator: add regulator_can_change_voltage stub
@ 2014-06-04 14:46 Arnd Bergmann
2014-06-04 15:44 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2014-06-04 14:46 UTC (permalink / raw)
To: linux-arm-kernel
When CONFIG_REGULATOR is not set, we cannot call
regulator_can_change_voltage() from a device driver, which results
in a build error like
video/fbdev/omap2/dss/hdmi5.c: In function 'hdmi_init_regulator':
video/fbdev/omap2/dss/hdmi5.c:149:2: error: implicit declaration of function 'regulator_can_change_voltage' [-Werror=implicit-function-declaration]
even for drivers that don't require the regulator API normally.
Such a use was recently added in the omap2+ hdmi driver.
This avoids the problem by adding a static inline function
stub in the API header, as we have for most of the other
regulator functions as well.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Mark Brown <broonie@kernel.org>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index a2d9d81..14ec18d 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -395,6 +395,11 @@ static inline void regulator_bulk_free(int num_consumers,
{
}
+static inline int regulator_can_change_voltage(struct regulator *regulator)
+{
+ return 0;
+}
+
static inline int regulator_set_voltage(struct regulator *regulator,
int min_uV, int max_uV)
{
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] regulator: add regulator_can_change_voltage stub
2014-06-04 14:46 [PATCH] regulator: add regulator_can_change_voltage stub Arnd Bergmann
@ 2014-06-04 15:44 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2014-06-04 15:44 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jun 04, 2014 at 04:46:00PM +0200, Arnd Bergmann wrote:
> When CONFIG_REGULATOR is not set, we cannot call
> regulator_can_change_voltage() from a device driver, which results
> in a build error like
Applied, thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140604/cdefb64b/attachment.sig>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-06-04 15:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-04 14:46 [PATCH] regulator: add regulator_can_change_voltage stub Arnd Bergmann
2014-06-04 15:44 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox