Skip to contentSkip to conversation

pinctrl: aw9523: allow building as loadable module

PATCH In review Arnd Bergmann 2 participants 2 messages Mar 7, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: aw9523: allow building as loadable module

From: Arnd Bergmann <[email protected]>

When CONFIG_I2C is set to =m, the new aw9523 driver fails to link:

arm-linux-gnueabi-ld: drivers/pinctrl/pinctrl-aw9523.o: in function `aw9523_probe':
pinctrl-aw9523.c:(.text+0x9f8): undefined reference to `__devm_regmap_init_i2c'
arm-linux-gnueabi-ld: drivers/pinctrl/pinctrl-aw9523.o: in function `aw9523_driver_init':
pinctrl-aw9523.c:(.init.text+0x4): undefined reference to `i2c_register_driver'
arm-linux-gnueabi-ld: drivers/pinctrl/pinctrl-aw9523.o: in function `aw9523_driver_exit':
pinctrl-aw9523.c:(.exit.text+0x2): undefined reference to `i2c_del_driver'

Make it a tristate symbol so the dependency is correctly honored.

Fixes bfa5aa367a82 ("pinctrl: Add driver for Awinic AW9523/B I2C GPIO Expander")
---
 drivers/pinctrl/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/Kconfig +1 -1
index 21d38bf2d1ca..d45657aa986a 100644
@@ -128,7 +128,7 @@ config PINCTRL_AXP209
 	  Say Y to enable pinctrl and GPIO support for the AXP209 PMIC.
 
 config PINCTRL_AW9523
-	bool "Awinic AW9523/AW9523B I2C GPIO expander pinctrl driver"
+	tristate "Awinic AW9523/AW9523B I2C GPIO expander pinctrl driver"
 	depends on OF && I2C
 	select PINMUX
 	select PINCONF
Signature · 1 line
2.39.2
#1 lore raw
Quoted 9 lines · Arnd Bergmann

When CONFIG_I2C is set to =m, the new aw9523 driver fails to link:

arm-linux-gnueabi-ld: drivers/pinctrl/pinctrl-aw9523.o: in function `aw9523_probe':
pinctrl-aw9523.c:(.text+0x9f8): undefined reference to `__devm_regmap_init_i2c'
arm-linux-gnueabi-ld: drivers/pinctrl/pinctrl-aw9523.o: in function `aw9523_driver_init':
pinctrl-aw9523.c:(.init.text+0x4): undefined reference to `i2c_register_driver'
arm-linux-gnueabi-ld: drivers/pinctrl/pinctrl-aw9523.o: in function `aw9523_driver_exit':
pinctrl-aw9523.c:(.exit.text+0x2): undefined reference to `i2c_del_driver'

Quoted 4 lines

Make it a tristate symbol so the dependency is correctly honored.

Fixes bfa5aa367a82 ("pinctrl: Add driver for Awinic AW9523/B I2C GPIO Expander")

I sent something similar yesterday:
https://lore.kernel.org/linux-gpio/[email protected]/

Thanks anyway!

Yours,
Linus Walleij