linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] thermal: mediatek: add missing dependencies
@ 2016-02-19 22:36 Arnd Bergmann
  2016-02-23  8:55 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2016-02-19 22:36 UTC (permalink / raw)
  To: Eduardo Valentin
  Cc: linux-arm-kernel, Arnd Bergmann, linux-mediatek, linux-pm,
	Matthias Brugger, Zhang Rui, Sascha Hauer, linux-kernel

The newly added mtk_thermal driver uses the generic reset
and nvmem infrastructure, but lacks a dependency that enforces
them from actually being present:

drivers/thermal/mtk_thermal.c: In function 'mtk_thermal_probe':
drivers/thermal/mtk_thermal.c:560:8: error: implicit declaration of function 'device_reset' [-Werror=implicit-function-declaration]
drivers/thermal/built-in.o: In function `mtk_thermal_probe':
mtk_thermal.c:(.text+0x7fb0): undefined reference to `nvmem_cell_get'
mtk_thermal.c:(.text+0x7fd8): undefined reference to `nvmem_cell_read'
mtk_thermal.c:(.text+0x7fe4): undefined reference to `nvmem_cell_put'

Without CONFIG_THERMAL, the driver cannot build, so this needs
to be a hard dependency.

For CONFIG_NVMEM, the header file allows building the driver even
when the subsystem is disabled, but we get the link error above
when nvmem is built as a module and the thermal driver is built-in,
so we can allow compile-testing when NVMEM is completely disabled,
but otherwise require the dependency.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/thermal/Kconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
index 5e7c97a3f1d8..75d164341f0d 100644
--- a/drivers/thermal/Kconfig
+++ b/drivers/thermal/Kconfig
@@ -368,6 +368,8 @@ config INTEL_PCH_THERMAL
 config MTK_THERMAL
 	tristate "Temperature sensor driver for mediatek SoCs"
 	depends on ARCH_MEDIATEK || COMPILE_TEST
+	depends on NVMEM || (!NVMEM && COMPILE_TEST)
+	depends on RESET_CONTROLLER
 	default y
 	help
 	  Enable this option if you want to have support for thermal management
-- 
2.7.0


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

end of thread, other threads:[~2016-02-23  8:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-19 22:36 [PATCH] thermal: mediatek: add missing dependencies Arnd Bergmann
2016-02-23  8:55 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).