All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: max8973: add THERMAL_OF dependency
@ 2016-01-08 20:06 ` Arnd Bergmann
  0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2016-01-08 20:06 UTC (permalink / raw)
  To: broonie
  Cc: Liam Girdwood, linux-kernel, linux-arm-kernel, linux-tegra,
	linux-pm, Zhang Rui, Eduardo Valentin

From 9f5ddfc667eb45dc2c5459e5acc5de45572456cd Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Fri, 8 Jan 2016 20:59:29 +0100
Subject: [PATCH] regulator: max8973: add THERMAL_OF dependency

The max8973 regulator driver has gained thermal support, but it
now fails to link when the driver is built-in and CONFIG_THERMAL=m:

drivers/built-in.o: In function `max8973_remove':
console.c:(.text+0x94ac4): undefined reference to `thermal_zone_of_sensor_unregister'
drivers/built-in.o: In function `max8973_probe':
console.c:(.text+0x95710): undefined reference to `thermal_zone_of_sensor_register'

This adds a dependency "depends on THERMAL || !THERMAL_OF" to ensure
that the driver cannot be built-in when THERMAL=m but is forced to
be a module as well, unless THERMAL_OF is disabled.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 1b7a4c6a9eea ("regulator: max8973: add support for junction thermal warning")
---
I've run into the same problem a couple of times now, with every driver
that calls thermal_zone_of_sensor_register(). I think we need a better
solution in general, but this fixes the immediate build error for now.

Maybe we should replace the "#ifdef CONFIG_THERMAL_OF" with "#if
IS_REACHABLE(CONFIG_THERMAL) && IS_ENABLED(CONFIG_THERMAL_OF)"?
The disadvantage of that is that the thermal management would be
silently disabled rather than cause a link error, and that may also
not be desired.

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 8155e80dd3f8..7df9da82f592 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -383,6 +383,7 @@ config REGULATOR_MAX8952
 config REGULATOR_MAX8973
 	tristate "Maxim MAX8973 voltage regulator "
 	depends on I2C
+	depends on THERMAL || !THERMAL_OF
 	select REGMAP_I2C
 	help
 	  The MAXIM MAX8973 high-efficiency. three phase, DC-DC step-down


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

* [PATCH] regulator: max8973: add THERMAL_OF dependency
@ 2016-01-08 20:06 ` Arnd Bergmann
  0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2016-01-08 20:06 UTC (permalink / raw)
  To: broonie
  Cc: Liam Girdwood, linux-kernel, linux-arm-kernel, linux-tegra,
	linux-pm, Zhang Rui, Eduardo Valentin

>From 9f5ddfc667eb45dc2c5459e5acc5de45572456cd Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Fri, 8 Jan 2016 20:59:29 +0100
Subject: [PATCH] regulator: max8973: add THERMAL_OF dependency

The max8973 regulator driver has gained thermal support, but it
now fails to link when the driver is built-in and CONFIG_THERMAL=m:

drivers/built-in.o: In function `max8973_remove':
console.c:(.text+0x94ac4): undefined reference to `thermal_zone_of_sensor_unregister'
drivers/built-in.o: In function `max8973_probe':
console.c:(.text+0x95710): undefined reference to `thermal_zone_of_sensor_register'

This adds a dependency "depends on THERMAL || !THERMAL_OF" to ensure
that the driver cannot be built-in when THERMAL=m but is forced to
be a module as well, unless THERMAL_OF is disabled.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 1b7a4c6a9eea ("regulator: max8973: add support for junction thermal warning")
---
I've run into the same problem a couple of times now, with every driver
that calls thermal_zone_of_sensor_register(). I think we need a better
solution in general, but this fixes the immediate build error for now.

Maybe we should replace the "#ifdef CONFIG_THERMAL_OF" with "#if
IS_REACHABLE(CONFIG_THERMAL) && IS_ENABLED(CONFIG_THERMAL_OF)"?
The disadvantage of that is that the thermal management would be
silently disabled rather than cause a link error, and that may also
not be desired.

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 8155e80dd3f8..7df9da82f592 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -383,6 +383,7 @@ config REGULATOR_MAX8952
 config REGULATOR_MAX8973
 	tristate "Maxim MAX8973 voltage regulator "
 	depends on I2C
+	depends on THERMAL || !THERMAL_OF
 	select REGMAP_I2C
 	help
 	  The MAXIM MAX8973 high-efficiency. three phase, DC-DC step-down

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

* [PATCH] regulator: max8973: add THERMAL_OF dependency
@ 2016-01-08 20:06 ` Arnd Bergmann
  0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2016-01-08 20:06 UTC (permalink / raw)
  To: linux-arm-kernel

>From 9f5ddfc667eb45dc2c5459e5acc5de45572456cd Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Fri, 8 Jan 2016 20:59:29 +0100
Subject: [PATCH] regulator: max8973: add THERMAL_OF dependency

The max8973 regulator driver has gained thermal support, but it
now fails to link when the driver is built-in and CONFIG_THERMAL=m:

drivers/built-in.o: In function `max8973_remove':
console.c:(.text+0x94ac4): undefined reference to `thermal_zone_of_sensor_unregister'
drivers/built-in.o: In function `max8973_probe':
console.c:(.text+0x95710): undefined reference to `thermal_zone_of_sensor_register'

This adds a dependency "depends on THERMAL || !THERMAL_OF" to ensure
that the driver cannot be built-in when THERMAL=m but is forced to
be a module as well, unless THERMAL_OF is disabled.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 1b7a4c6a9eea ("regulator: max8973: add support for junction thermal warning")
---
I've run into the same problem a couple of times now, with every driver
that calls thermal_zone_of_sensor_register(). I think we need a better
solution in general, but this fixes the immediate build error for now.

Maybe we should replace the "#ifdef CONFIG_THERMAL_OF" with "#if
IS_REACHABLE(CONFIG_THERMAL) && IS_ENABLED(CONFIG_THERMAL_OF)"?
The disadvantage of that is that the thermal management would be
silently disabled rather than cause a link error, and that may also
not be desired.

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 8155e80dd3f8..7df9da82f592 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -383,6 +383,7 @@ config REGULATOR_MAX8952
 config REGULATOR_MAX8973
 	tristate "Maxim MAX8973 voltage regulator "
 	depends on I2C
+	depends on THERMAL || !THERMAL_OF
 	select REGMAP_I2C
 	help
 	  The MAXIM MAX8973 high-efficiency. three phase, DC-DC step-down

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

* Re: [PATCH] regulator: max8973: add THERMAL_OF dependency
  2016-01-08 20:06 ` Arnd Bergmann
@ 2016-01-11 16:47   ` Mark Brown
  -1 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2016-01-11 16:47 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Liam Girdwood, linux-kernel, linux-arm-kernel, linux-tegra,
	linux-pm, Zhang Rui, Eduardo Valentin

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

On Fri, Jan 08, 2016 at 09:06:43PM +0100, Arnd Bergmann wrote:

> I've run into the same problem a couple of times now, with every driver
> that calls thermal_zone_of_sensor_register(). I think we need a better
> solution in general, but this fixes the immediate build error for now.

Yes, this doesn't feel very clever especially in this use case where
we're mostly providing data into the thermal framework and not really
relying on it for anything.

> Maybe we should replace the "#ifdef CONFIG_THERMAL_OF" with "#if
> IS_REACHABLE(CONFIG_THERMAL) && IS_ENABLED(CONFIG_THERMAL_OF)"?
> The disadvantage of that is that the thermal management would be
> silently disabled rather than cause a link error, and that may also
> not be desired.

Perhaps we should ensure that at least some glue code is bool rather
than modular?  That's got downsides too, it increases the amount of code
that gets built into the kernel but perhaps that's an acceptable
tradeoff here.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* [PATCH] regulator: max8973: add THERMAL_OF dependency
@ 2016-01-11 16:47   ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2016-01-11 16:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jan 08, 2016 at 09:06:43PM +0100, Arnd Bergmann wrote:

> I've run into the same problem a couple of times now, with every driver
> that calls thermal_zone_of_sensor_register(). I think we need a better
> solution in general, but this fixes the immediate build error for now.

Yes, this doesn't feel very clever especially in this use case where
we're mostly providing data into the thermal framework and not really
relying on it for anything.

> Maybe we should replace the "#ifdef CONFIG_THERMAL_OF" with "#if
> IS_REACHABLE(CONFIG_THERMAL) && IS_ENABLED(CONFIG_THERMAL_OF)"?
> The disadvantage of that is that the thermal management would be
> silently disabled rather than cause a link error, and that may also
> not be desired.

Perhaps we should ensure that at least some glue code is bool rather
than modular?  That's got downsides too, it increases the amount of code
that gets built into the kernel but perhaps that's an acceptable
tradeoff here.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160111/74a24dcc/attachment.sig>

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

* Applied "regulator: max8973: add THERMAL_OF dependency" to the regulator tree
  2016-01-08 20:06 ` Arnd Bergmann
                   ` (2 preceding siblings ...)
  (?)
@ 2016-01-11 18:34 ` Mark Brown
  -1 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2016-01-11 18:34 UTC (permalink / raw)
  To: Arnd Bergmann, Mark Brown; +Cc: linux-kernel

The patch

   regulator: max8973: add THERMAL_OF dependency

has been applied to the regulator tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 0e3571989d329ea7d356c0e29e267df0567f5165 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Fri, 8 Jan 2016 21:06:43 +0100
Subject: [PATCH] regulator: max8973: add THERMAL_OF dependency

>From 9f5ddfc667eb45dc2c5459e5acc5de45572456cd Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Fri, 8 Jan 2016 20:59:29 +0100
Subject: [PATCH] regulator: max8973: add THERMAL_OF dependency

The max8973 regulator driver has gained thermal support, but it
now fails to link when the driver is built-in and CONFIG_THERMAL=m:

drivers/built-in.o: In function `max8973_remove':
console.c:(.text+0x94ac4): undefined reference to `thermal_zone_of_sensor_unregister'
drivers/built-in.o: In function `max8973_probe':
console.c:(.text+0x95710): undefined reference to `thermal_zone_of_sensor_register'

This adds a dependency "depends on THERMAL || !THERMAL_OF" to ensure
that the driver cannot be built-in when THERMAL=m but is forced to
be a module as well, unless THERMAL_OF is disabled.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 1b7a4c6a9eea ("regulator: max8973: add support for junction thermal warning")
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/regulator/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 8df0b0e62976..e58517f27a3a 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -374,6 +374,7 @@ config REGULATOR_MAX8952
 config REGULATOR_MAX8973
 	tristate "Maxim MAX8973 voltage regulator "
 	depends on I2C
+	depends on THERMAL || !THERMAL_OF
 	select REGMAP_I2C
 	help
 	  The MAXIM MAX8973 high-efficiency. three phase, DC-DC step-down
-- 
2.7.0.rc3

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

end of thread, other threads:[~2016-01-11 18:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-08 20:06 [PATCH] regulator: max8973: add THERMAL_OF dependency Arnd Bergmann
2016-01-08 20:06 ` Arnd Bergmann
2016-01-08 20:06 ` Arnd Bergmann
2016-01-11 16:47 ` Mark Brown
2016-01-11 16:47   ` Mark Brown
2016-01-11 18:34 ` Applied "regulator: max8973: add THERMAL_OF dependency" to the regulator tree Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.