[PATCH] nvmem: Fix build error of missing devm_ioremap_resource on UM

From: Krzysztof Kozlowski
Date: Thu Mar 03 2016 - 03:33:30 EST


The devres.o gets linked if HAS_IOMEM is present so on ARCH=um
allyesconfig (COMPILE_TEST) failed on many files with:

drivers/built-in.o: In function `qfprom_probe':
qfprom.c:(.text+0x4c5bcb): undefined reference to `devm_ioremap_resource'

The users of devm_ioremap_resource() which are compile-testable should
depend on HAS_IOMEM.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@xxxxxxxxxxx>
---
drivers/nvmem/Kconfig | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig
index 5bd18cc1a69c..0843e4fd7e7a 100644
--- a/drivers/nvmem/Kconfig
+++ b/drivers/nvmem/Kconfig
@@ -27,7 +27,7 @@ config NVMEM_IMX_OCOTP

config NVMEM_LPC18XX_EEPROM
tristate "NXP LPC18XX EEPROM Memory Support"
- depends on ARCH_LPC18XX || COMPILE_TEST
+ depends on ARCH_LPC18XX || COMPILE_TEST && HAS_IOMEM
help
Say Y here to include support for NXP LPC18xx EEPROM memory found in
NXP LPC185x/3x and LPC435x/3x/2x/1x devices.
@@ -36,7 +36,7 @@ config NVMEM_LPC18XX_EEPROM

config NVMEM_MXS_OCOTP
tristate "Freescale MXS On-Chip OTP Memory Support"
- depends on ARCH_MXS || COMPILE_TEST
+ depends on ARCH_MXS || COMPILE_TEST && HAS_IOMEM
help
If you say Y here, you will get readonly access to the
One Time Programmable memory pages that are stored
@@ -47,7 +47,7 @@ config NVMEM_MXS_OCOTP

config MTK_EFUSE
tristate "Mediatek SoCs EFUSE support"
- depends on ARCH_MEDIATEK || COMPILE_TEST
+ depends on ARCH_MEDIATEK || COMPILE_TEST && HAS_IOMEM
select REGMAP_MMIO
help
This is a driver to access hardware related data like sensor
@@ -58,7 +58,7 @@ config MTK_EFUSE

config QCOM_QFPROM
tristate "QCOM QFPROM Support"
- depends on ARCH_QCOM || COMPILE_TEST
+ depends on ARCH_QCOM || COMPILE_TEST && HAS_IOMEM
select REGMAP_MMIO
help
Say y here to enable QFPROM support. The QFPROM provides access
@@ -69,7 +69,7 @@ config QCOM_QFPROM

config ROCKCHIP_EFUSE
tristate "Rockchip eFuse Support"
- depends on ARCH_ROCKCHIP || COMPILE_TEST
+ depends on ARCH_ROCKCHIP || COMPILE_TEST && HAS_IOMEM
help
This is a simple drive to dump specified values of Rockchip SoC
from eFuse, such as cpu-leakage.
@@ -90,7 +90,7 @@ config NVMEM_SUNXI_SID

config NVMEM_VF610_OCOTP
tristate "VF610 SoC OCOTP support"
- depends on SOC_VF610 || COMPILE_TEST
+ depends on SOC_VF610 || COMPILE_TEST && HAS_IOMEM
help
This is a driver for the 'OCOTP' peripheral available on Vybrid
devices like VF5xx and VF6xx.
--
2.5.0