thermal: imx: add NVMEM dependency
authorArnd Bergmann <arnd@arndb.de>
Mon, 18 Sep 2017 20:48:16 +0000 (22:48 +0200)
committerZhang Rui <rui.zhang@intel.com>
Wed, 18 Oct 2017 02:24:13 +0000 (10:24 +0800)
The driver now fails to link into vmlinux when CONFIG_NVMEM is a loadable
module:

drivers/thermal/imx_thermal.o: In function `imx_thermal_probe':
imx_thermal.c:(.text+0x360): undefined reference to `nvmem_cell_read_u32'
imx_thermal.c:(.text+0x360): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `nvmem_cell_read_u32'
imx_thermal.c:(.text+0x388): undefined reference to `nvmem_cell_read_u32'
imx_thermal.c:(.text+0x388): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `nvmem_cell_read_u32'

This adds a Kconfig dependency to force it to be a module as well
when its dependency is loadable.

Fixes: 7fe5ba04fcdc ("thermal: imx: Add support for reading OCOTP through nvmem")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
drivers/thermal/Kconfig

index 07002df4f83acdde2efdf3f51299976ef25d2e1e..cb14f1ec59539d436028fb5f45d82d9aee9a54f3 100644 (file)
@@ -206,6 +206,7 @@ config HISI_THERMAL
 config IMX_THERMAL
        tristate "Temperature sensor driver for Freescale i.MX SoCs"
        depends on (ARCH_MXC && CPU_THERMAL) || COMPILE_TEST
+       depends on NVMEM || !NVMEM
        depends on MFD_SYSCON
        depends on OF
        help