Skip to contentSkip to conversation

hwmon: rpi: fix link error against rpi_firmware module

PATCH In review Arnd Bergmann 3 participants 3 messages Jul 9, 2018 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: rpi: fix link error against rpi_firmware module

Compile-testing without CONFIG_RASPBERRYPI_FIRMWARE is possible, but we cannot build the rpi hwmon driver into the kernel if the firmware code is a loadable module:

drivers/hwmon/raspberrypi-hwmon.o: In function `rpi_hwmon_probe':
raspberrypi-hwmon.c:(.text+0x140): undefined reference to rpi_firmware_property' drivers/hwmon/raspberrypi-hwmon.o: In function get_values_poll':
raspberrypi-hwmon.c:(.text+0x350): undefined reference to `rpi_firmware_property'

This adapts the dependency to disallow that combination.

Fixes 3c493c885cf8 ("hwmon: Add support for RPi voltage sensor")
---
 drivers/hwmon/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/Kconfig +1 -1
index a4e5d3c9fc71..81da17a42dc9 100644
@@ -1322,7 +1322,7 @@ config SENSORS_PWM_FAN
 
 config SENSORS_RASPBERRYPI_HWMON
 	tristate "Raspberry Pi voltage monitor"
-	depends on RASPBERRYPI_FIRMWARE || COMPILE_TEST
+	depends on RASPBERRYPI_FIRMWARE || (COMPILE_TEST && !RASPBERRYPI_FIRMWARE)
 	help
 	  If you say yes here you get support for voltage sensor on the
 	  Raspberry Pi.
Signature · 1 line
2.9.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Arnd Bergmann

Compile-testing without CONFIG_RASPBERRYPI_FIRMWARE is possible, but we cannot build the rpi hwmon driver into the kernel if the firmware code is a loadable module:

drivers/hwmon/raspberrypi-hwmon.o: In function `rpi_hwmon_probe':
raspberrypi-hwmon.c:(.text+0x140): undefined reference to rpi_firmware_property' drivers/hwmon/raspberrypi-hwmon.o: In function get_values_poll':
raspberrypi-hwmon.c:(.text+0x350): undefined reference to `rpi_firmware_property'

Quoted 4 lines

This adapts the dependency to disallow that combination.

Fixes 3c493c885cf8 ("hwmon: Add support for RPi voltage sensor")

This will have to go through Florian's tree.

Guenter

Quoted 9 lines
---
 drivers/hwmon/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/Kconfig +0 -0
index a4e5d3c9fc71..81da17a42dc9 100644

drivers/hwmon/Kconfig config SENSORS_PWM_FAN · line 1325

Quoted 5 lines
drivers/hwmon/Kconfig +1 -1
@@ -1322,7 +1322,7 @@ config SENSORS_PWM_FAN
 
 config SENSORS_RASPBERRYPI_HWMON
 	tristate "Raspberry Pi voltage monitor"
-	depends on RASPBERRYPI_FIRMWARE || COMPILE_TEST
+	depends on RASPBERRYPI_FIRMWARE || (COMPILE_TEST && !RASPBERRYPI_FIRMWARE)

Is that one of the situations where "imply RASPBERRYPI_FIRMWARE" would be useful ?

Quoted 6 lines
drivers/hwmon/Kconfig +0 -0
 	help
 	  If you say yes here you get support for voltage sensor on the
 	  Raspberry Pi.
Signature · 1 line
2.9.0
#2 lore raw
Quoted 10 lines · Guenter Roeck
Quoted 9 lines · Arnd Bergmann

Compile-testing without CONFIG_RASPBERRYPI_FIRMWARE is possible, but we cannot build the rpi hwmon driver into the kernel if the firmware code is a loadable module:

drivers/hwmon/raspberrypi-hwmon.o: In function `rpi_hwmon_probe':
raspberrypi-hwmon.c:(.text+0x140): undefined reference to rpi_firmware_property' drivers/hwmon/raspberrypi-hwmon.o: In function get_values_poll':
raspberrypi-hwmon.c:(.text+0x350): undefined reference to `rpi_firmware_property'

Quoted 8 lines
Quoted 4 lines

This adapts the dependency to disallow that combination.

Fixes 3c493c885cf8 ("hwmon: Add support for RPi voltage sensor")

This will have to go through Florian's tree.

Thanks for looping me in, I just sent the pull requests out Arnd, do you want me to squash this into 3c493c885cf8 ("hwmon: Add support for RPi voltage sensor") and resubmit?

Ray just informed me he has additional DTS stuff he would like to see included.

Quoted 27 lines

Guenter

Quoted 9 lines
---
 drivers/hwmon/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/Kconfig +0 -0
index a4e5d3c9fc71..81da17a42dc9 100644

drivers/hwmon/Kconfig config SENSORS_PWM_FAN · line 1325

Quoted 5 lines
drivers/hwmon/Kconfig +1 -1
@@ -1322,7 +1322,7 @@ config SENSORS_PWM_FAN
 
 config SENSORS_RASPBERRYPI_HWMON
 	tristate "Raspberry Pi voltage monitor"
-	depends on RASPBERRYPI_FIRMWARE || COMPILE_TEST
+	depends on RASPBERRYPI_FIRMWARE || (COMPILE_TEST && !RASPBERRYPI_FIRMWARE)

Is that one of the situations where "imply RASPBERRYPI_FIRMWARE" would be useful ?

Quoted 6 lines
drivers/hwmon/Kconfig +0 -0
 	help
 	  If you say yes here you get support for voltage sensor on the
 	  Raspberry Pi.
Signature · 1 line
2.9.0
Signature · 1 line
Florian