Skip to contentSkip to conversation

build error with CONFIG_REGMAP=m and CONFIG_REGULATOR=y

PATCH Hauke Mehrtens 2 participants 3 messages Nov 17, 2013 Voltage and current regulator framework

lore
Share & tools
lore
#0 lore raw

Hi,

In OpenWrt we are seeing some build errors when CONFIG_REGMAP=m and CONFIG_REGULATOR=y are set.

/drivers/regulator/core.c accesses some regmap functions, but they are compiled into a module and not into a kernel. When CONFIG_REGMAP is not set the header file replaces the functions with empty static inline functions.

With kernel 3.10.18 I see the following build error:

drivers/built-in.o: In function `regulator_get_bypass_regmap':
/drivers/regulator/core.c:2989: undefined reference to regmap_read' drivers/built-in.o: In function regulator_get_voltage_sel_regmap':
/drivers/regulator/core.c:2199: undefined reference to regmap_read' drivers/built-in.o: In function regulator_is_enabled_regmap':
/drivers/regulator/core.c:1916: undefined reference to regmap_read' drivers/built-in.o: In function regulator_set_bypass_regmap':
/drivers/regulator/core.c:2973: undefined reference to regmap_update_bits' drivers/built-in.o: In function regulator_set_voltage_sel_regmap':
/drivers/regulator/core.c:2226: undefined reference to regmap_update_bits' /drivers/regulator/core.c:2232: undefined reference to regmap_update_bits' drivers/built-in.o: In function `regulator_disable_regmap':
/drivers/regulator/core.c:1968: undefined reference to regmap_update_bits' drivers/built-in.o: In function regulator_enable_regmap':
/drivers/regulator/core.c:1945: undefined reference to regmap_update_bits' drivers/built-in.o: In function regulator_register':
/drivers/regulator/core.c:3581: undefined reference to dev_get_regmap' /drivers/regulator/core.c:3582: undefined reference to dev_get_regmap' /drivers/regulator/core.c:3584: undefined reference to `dev_get_regmap' make[4]: *** [vmlinux] Error 1

The following patch would be a solution, but it causes a recursive dependency:

drivers/regulator/Kconfig +1 -0
@@ -1,5 +1,6 @@
 menuconfig REGULATOR
 	bool "Voltage and Current Regulator Support"
+	depends on REGMAP || REGMAP = n
 	help
 	  Generic Voltage and Current Regulator support.
 

drivers/regulator/Kconfig:1:error: recursive dependency detected!
drivers/regulator/Kconfig:1: symbol REGULATOR depends on REGMAP
drivers/base/regmap/Kconfig:5: symbol REGMAP is selected by REGMAP_I2C
drivers/base/regmap/Kconfig:11: symbol REGMAP_I2C is selected by
REGULATOR_FAN53555
drivers/regulator/Kconfig:124: symbol REGULATOR_FAN53555 depends on
REGULATOR

I am not familiar with the regmap and the regulator framework, but I would suggest to make REGULATOR depend on REGMAP.

Hauke

maintainer
#1 lore raw
Quoted 2 lines · Hauke Mehrtens

In OpenWrt we are seeing some build errors when CONFIG_REGMAP=m and CONFIG_REGULATOR=y are set.

REGMAP is a bool config option, it should not be possible to set it to m. How have you managed to do that?

#2 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 8 lines · Mark Brown
Quoted 2 lines · Hauke Mehrtens

In OpenWrt we are seeing some build errors when CONFIG_REGMAP=m and CONFIG_REGULATOR=y are set.

REGMAP is a bool config option, it should not be possible to set it to m. How have you managed to do that?

Sorry, I you are right, I just saw we have a patch applied on top of the mainline kernel which makes it possible to build REGMAP as module.

Hauke
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSiOgfAAoJEIZ0px9YPRMygR4P/inb+qZKSSA7qloN2ipKasbC mDKV/LivY6l3Je+rWTRCESkGOw0jO09rO1AizCoUN47u6yYuC6/IGIPioDXTciFf iDl46Lhfirv3rlWyrQTC6ZAAxcQUzFJNgXD0hb+ehw3MBC9okB5NQgq9QATtpW9L Bbu7vCgqG7bxCXXq0DW/ygPMR5axKWQwbQdDCfz+06wYqWQqj2okWtHvhXCe7Skb ROZ8FvOcnXKKjoGOEJRtbcfUt44dIM8RGJtKj5vjXtnSm+eJQhL1OzqUxOY7OODW Fxqs97N7rrsPVwXNRYSrHjtmul3feLUaxALXQiSskjS8zJsJBgR9jGJjMp2auN5B 4ffxa0+thFsSNSXQd2bfDPnZzZKZf2EWr3h0BqWZPjN60pIji/WUXMSecVd+9zNH axONP2lKOp0hPxsSi0hvLUGHAyAsOTzShPKjV+vIosb9aFn5/3GeQqOrY6abmF/1 HPoIds00q2B9VVV83PQeLvMFhjcW++1HDhP7QJ+QiUByN9I96M1Awd27ypsf5PT/ fKqIgumJk2Jy3rKmpOwMHlpONBhD39qW3tb9lmiXeWgAdvaSH/kuR5Lwsbe3vhvg p+hTwmubGTwFHaIKUD7APJk7daYUwR8VEP3fbwsYc3bCGMtN61FNyl5HymYteJMg 0g4dQrXMaPTZJcMTp4nz
=LoHr
-----END PGP SIGNATURE-----