• Axel Lin's avatar
    iio: dac: Fix build error when CONFIG_SPI_MASTER=y && CONFIG_I2C=m · 0ae5fb6f
    Axel Lin authored
    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.
    Reported-by: default avatarWu Fengguang <fengguang.wu@intel.com>
    Reported-by: default avatarRandy Dunlap <rdunlap@infradead.org>
    Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
    Acked-by: default avatarLars-Peter Clausen <lars@metafoo.de>
    Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
    0ae5fb6f
Kconfig 4.82 KB