Skip to contentSkip to conversation

pinctrl: mcp23s08: improve I2C Kconfig dependency

PATCH In review Arnd Bergmann 3 participants 3 messages May 30, 2017

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

PATCH 1/1 pinctrl: mcp23s08: improve I2C Kconfig dependency

With "SPI_MASTER=y && I2C=m", we can build mcp23s08 as a built-in driver, which then results in a link failure:

drivers/pinctrl/built-in.o: In function `mcp23s08_probe_one.isra.0':
:(.text+0x7910): undefined reference to __devm_regmap_init_i2c' drivers/pinctrl/built-in.o: In function mcp23s08_init':
:(.init.text+0x110): undefined reference to i2c_register_driver' drivers/pinctrl/built-in.o: In function mcp23s08_exit':
:(.exit.text+0x3c): undefined reference to `i2c_del_driver'

To avoid the problem, this adds another dependency on I2C that enforces mcp23s08 to be a loadable module whenever the I2C core is a module.

Fixes 64ac43e6fa28 ("gpio: mcp23s08: move to pinctrl")
---
 drivers/pinctrl/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/pinctrl/Kconfig +1 -0
index becda8f47e9e..ab4630ea305c 100644
@@ -149,6 +149,7 @@ config PINCTRL_FALCON
 config PINCTRL_MCP23S08
 	tristate "Microchip MCP23xxx I/O expander"
 	depends on SPI_MASTER || I2C
+	depends on I2C || I2C=n
 	select GPIOLIB_IRQCHIP
 	select REGMAP_I2C if I2C
 	select REGMAP_SPI if SPI_MASTER
Signature · 1 line
2.9.0
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 10 lines · Arnd Bergmann

With "SPI_MASTER=y && I2C=m", we can build mcp23s08 as a built-in driver, which then results in a link failure:

drivers/pinctrl/built-in.o: In function `mcp23s08_probe_one.isra.0':
:(.text+0x7910): undefined reference to __devm_regmap_init_i2c' drivers/pinctrl/built-in.o: In function mcp23s08_init':
:(.init.text+0x110): undefined reference to i2c_register_driver' drivers/pinctrl/built-in.o: In function mcp23s08_exit':
:(.exit.text+0x3c): undefined reference to `i2c_del_driver'

Quoted 5 lines

To avoid the problem, this adds another dependency on I2C that enforces mcp23s08 to be a loadable module whenever the I2C core is a module.

Fixes 64ac43e6fa28 ("gpio: mcp23s08: move to pinctrl")

-- Sebastian

Quoted 19 lines
---
 drivers/pinctrl/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/pinctrl/Kconfig +1 -0
index becda8f47e9e..ab4630ea305c 100644
@@ -149,6 +149,7 @@ config PINCTRL_FALCON
 config PINCTRL_MCP23S08
 	tristate "Microchip MCP23xxx I/O expander"
 	depends on SPI_MASTER || I2C
+	depends on I2C || I2C=n
 	select GPIOLIB_IRQCHIP
 	select REGMAP_I2C if I2C
 	select REGMAP_SPI if SPI_MASTER
Signature · 1 line
2.9.0
#2 lore raw
In reply to Arnd Bergmann
Quoted 10 lines · Arnd Bergmann

With "SPI_MASTER=y && I2C=m", we can build mcp23s08 as a built-in driver, which then results in a link failure:

drivers/pinctrl/built-in.o: In function `mcp23s08_probe_one.isra.0':
:(.text+0x7910): undefined reference to __devm_regmap_init_i2c' drivers/pinctrl/built-in.o: In function mcp23s08_init':
:(.init.text+0x110): undefined reference to i2c_register_driver' drivers/pinctrl/built-in.o: In function mcp23s08_exit':
:(.exit.text+0x3c): undefined reference to `i2c_del_driver'

Quoted 5 lines

To avoid the problem, this adds another dependency on I2C that enforces mcp23s08 to be a loadable module whenever the I2C core is a module.

Fixes 64ac43e6fa28 ("gpio: mcp23s08: move to pinctrl")

Patch applied!

Yours,
Linus Walleij