iio: dac: Fix build error when CONFIG_SPI_MASTER=y && CONFIG_I2C=m
PATCH v3 1/1 iio: dac: Fix build error when CONFIG_SPI_MASTER=y && CONFIG_I2C=m
This patch fixes below build error when CONFIG_SPI_MASTER=y && CONFIG_I2C=m:
drivers/built-in.o: In function `ad5064_i2c_write':drivers/iio/dac/ad5064.c:608: undefined reference to i2c_master_send' drivers/built-in.o: In function ad5064_i2c_register_driver':drivers/iio/dac/ad5064.c:646: undefined reference to i2c_register_driver' drivers/built-in.o: In function ad5064_i2c_unregister_driver':drivers/iio/dac/ad5064.c:651: undefined reference to `i2c_del_driver'
make: *** [vmlinux] Error 1
When CONFIG_I2C=m, meaning we can't build the drivers in with I2C support. Thus don't allow the drivers to be compiled as built-in when CONFIG_I2C=m.
The real fix though is to break the driver apart into a SPI part, an I2C part and a common part. But that's something for 3.11 while this is something for 3.10/stable.
---
v3: Update comment
drivers/iio/dac/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/iio/dac/Kconfig +3 -3
@@ -5,7 +5,7 @@ menu "Digital to analog converters" config AD5064 tristate "Analog Devices AD5064 and similar multi-channel DAC driver" - depends on (SPI_MASTER || I2C) + depends on (SPI_MASTER && I2C!=m) || I2C help Say yes here to build support for Analog Devices AD5024, AD5025, AD5044, AD5045, AD5064, AD5064-1, AD5065, AD5628, AD5629R, AD5648, AD5666, AD5668,
@@ -27,7 +27,7 @@ config AD5360 config AD5380 tristate "Analog Devices AD5380/81/82/83/84/90/91/92 DAC driver" - depends on (SPI_MASTER || I2C) + depends on (SPI_MASTER && I2C!=m) || I2C select REGMAP_I2C if I2C select REGMAP_SPI if SPI_MASTER help
@@ -57,7 +57,7 @@ config AD5624R_SPI config AD5446 tristate "Analog Devices AD5446 and similar single channel DACs driver" - depends on (SPI_MASTER || I2C) + depends on (SPI_MASTER && I2C!=m) || I2C help Say yes here to build support for Analog Devices AD5300, AD5301, AD5310, AD5311, AD5320, AD5321, AD5444, AD5446, AD5450, AD5451, AD5452, AD5453,
Signature · 1 line
1.8.1.2
Quoted 13 lines · Axel Lin
This patch fixes below build error when
CONFIG_SPI_MASTER=y&&CONFIG_I2C=m:
drivers/built-in.o: In function `ad5064_i2c_write':drivers/iio/dac/ad5064.c:608: undefined reference toi2c_master_send' drivers/built-in.o: In functionad5064_i2c_register_driver':drivers/iio/dac/ad5064.c:646: undefined reference toi2c_register_driver' drivers/built-in.o: In functionad5064_i2c_unregister_driver':drivers/iio/dac/ad5064.c:651: undefined reference to `i2c_del_driver'
make: *** [vmlinux] Error 1When
CONFIG_I2C=m, meaning we can't build the drivers in with I2C support. Thus don't allow the drivers to be compiled as built-in whenCONFIG_I2C=m.
Quoted 6 lines
The real fix though is to break the driver apart into a SPI part, an I2C part and a common part. But that's something for 3.11 while this is something for 3.10/stable.
Reported-by Wu Fengguang <[email protected]>Signed-off-by Axel Lin <[email protected]>
Thanks for taking care of this.
Jonathan when you apply this please also add:
since he reported the issue as well
Quoted 37 lines
---
v3: Update commentdrivers/iio/dac/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/iio/dac/Kconfig +3
-3@@ -5,7 +5,7 @@ menu "Digital to analog converters" config AD5064 tristate "Analog Devices AD5064 and similar multi-channel DAC driver" - depends on (SPI_MASTER || I2C) + depends on (SPI_MASTER && I2C!=m) || I2C help Say yes here to build support for Analog Devices AD5024, AD5025, AD5044, AD5045, AD5064, AD5064-1, AD5065, AD5628, AD5629R, AD5648, AD5666, AD5668,@@ -27,7 +27,7 @@ config AD5360 config AD5380 tristate "Analog Devices AD5380/81/82/83/84/90/91/92 DAC driver" - depends on (SPI_MASTER || I2C) + depends on (SPI_MASTER && I2C!=m) || I2C select REGMAP_I2C if I2C select REGMAP_SPI if SPI_MASTER help@@ -57,7 +57,7 @@ config AD5624R_SPI config AD5446 tristate "Analog Devices AD5446 and similar single channel DACs driver" - depends on (SPI_MASTER || I2C) + depends on (SPI_MASTER && I2C!=m) || I2C help Say yes here to build support for Analog Devices AD5300, AD5301, AD5310, AD5311, AD5320, AD5321, AD5444, AD5446, AD5450, AD5451, AD5452, AD5453,
Jonathan Cameron
maintainerQuoted 23 lines · Lars-Peter Clausen
Quoted 13 lines · Axel Lin
This patch fixes below build error when
CONFIG_SPI_MASTER=y&&CONFIG_I2C=m:
drivers/built-in.o: In function `ad5064_i2c_write':drivers/iio/dac/ad5064.c:608: undefined reference toi2c_master_send' drivers/built-in.o: In functionad5064_i2c_register_driver':drivers/iio/dac/ad5064.c:646: undefined reference toi2c_register_driver' drivers/built-in.o: In functionad5064_i2c_unregister_driver':drivers/iio/dac/ad5064.c:651: undefined reference to `i2c_del_driver'
make: *** [vmlinux] Error 1When
CONFIG_I2C=m, meaning we can't build the drivers in with I2C support. Thus don't allow the drivers to be compiled as built-in whenCONFIG_I2C=m.Quoted 6 lines
The real fix though is to break the driver apart into a SPI part, an I2C part and a common part. But that's something for 3.11 while this is something for 3.10/stable.
Reported-by Wu Fengguang <[email protected]>Signed-off-by Axel Lin <[email protected]>Thanks for taking care of this.
Quoted 8 lines
Jonathan when you apply this please also add:
Reported-by Randy Dunlap <[email protected]>since he reported the issue as well
Done and applied to fixes-togreg branch of iio.git
Thanks all.
Quoted 43 lines
Quoted 29 lines
---
v3: Update commentdrivers/iio/dac/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/iio/dac/Kconfig +2
-2@@ -5,7 +5,7 @@ menu "Digital to analog converters" config AD5064 tristate "Analog Devices AD5064 and similar multi-channel DAC driver" - depends on (SPI_MASTER || I2C) + depends on (SPI_MASTER && I2C!=m) || I2C help Say yes here to build support for Analog Devices AD5024, AD5025, AD5044, AD5045, AD5064, AD5064-1, AD5065, AD5628, AD5629R, AD5648, AD5666, AD5668,@@ -27,7 +27,7 @@ config AD5360 config AD5380 tristate "Analog Devices AD5380/81/82/83/84/90/91/92 DAC driver" - depends on (SPI_MASTER || I2C) + depends on (SPI_MASTER && I2C!=m) || I2C select REGMAP_I2C if I2C select REGMAP_SPI if SPI_MASTER helpdrivers/iio/dac/Kconfig config AD5624R_SPI · line 63
Quoted 8 lines
drivers/iio/dac/Kconfig +1
-1@@ -57,7 +57,7 @@ config AD5624R_SPI config AD5446 tristate "Analog Devices AD5446 and similar single channel DACs driver" - depends on (SPI_MASTER || I2C) + depends on (SPI_MASTER && I2C!=m) || I2C help Say yes here to build support for Analog Devices AD5300, AD5301, AD5310, AD5311, AD5320, AD5321, AD5444, AD5446, AD5450, AD5451, AD5452, AD5453,--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html