thermal: imx: add NVMEM dependency
PATCH 1/1 thermal: imx: add NVMEM dependency
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.
--- drivers/thermal/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/thermal/Kconfig +1 -0
@@ -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
Signature · 1 line
2.9.0
Quoted 13 lines · Arnd Bergmann
The driver now fails to link into vmlinux when
CONFIG_NVMEMis 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_CALL26against undefined symbolnvmem_cell_read_u32' imx_thermal.c:(.text+0x388): undefined reference tonvmem_cell_read_u32'
imx_thermal.c:(.text+0x388): relocation truncated to fit:R_AARCH64_CALL26against undefined symbol `nvmem_cell_read_u32'
Quoted 2 lines
This adds a
Kconfigdependency to force it to be a module as well when its dependency is loadable.
This must be a very strange config with NVMEM=m and IMX_THERMAL=y on arm64. Still, it makes sense that it should work at least at the Kconfig level.
Quoted 2 lines
Fixes 7fe5ba04fcdc ("thermal: imx: Add support for reading OCOTP through nvmem")Signed-off-by Arnd Bergmann <[email protected]>
drivers/thermal/Kconfig config HISI_THERMAL · line 209
Quoted 9 lines
drivers/thermal/Kconfig +0
-0@@ -206,6 +206,7 @@ config HISI_THERMALconfig
IMX_THERMAL
tristate "Temperature sensor driver for Freescale i.MX SoCs" depends on (ARCH_MXC&&CPU_THERMAL) ||COMPILE_TESTdrivers/thermal/Kconfig +1
-0+ depends on NVMEM || !NVMEM
The || !NVMEM part is so that it also works when NVMEM=n, right?
Quoted 12 lines · Leonard Crestez
drivers/thermal/Kconfig config HISI_THERMAL · line 209
Quoted 9 lines · Arnd Bergmann
drivers/thermal/Kconfig +1
-0@@ -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 || !NVMEMThe || !NVMEM part is so that it also works when NVMEM=n, right?
Correct, this is a very strange Kconfig expression when you see it the first time, but we do the same thing in a lot of places that can either use another subsystem when it is enabled (but have a link-time dependency), or can work fine without it.
Arnd