ASoC: fix I2C build errors
authorRandy Dunlap <randy.dunlap@oracle.com>
Mon, 10 Aug 2009 23:04:39 +0000 (16:04 -0700)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 11 Aug 2009 09:47:25 +0000 (10:47 +0100)
Fix soc build errors when I2C is built as a loadable module:

(.text+0x5d26b): undefined reference to `i2c_master_send'
soc-cache.c:(.text+0x5d32d): undefined reference to `i2c_transfer'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/soc-cache.c

index 56ec3f22bf1c26711dd44f78c01f1189aaf4c4f4..c8ceddc2a26c8c6af4c1f1b93135fd7b5f8e8e98 100644 (file)
@@ -108,7 +108,7 @@ static unsigned int snd_soc_8_16_read(struct snd_soc_codec *codec,
                return cache[reg];
 }
 
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+#if defined(CONFIG_I2C) || (defined(CONFIG_I2C_MODULE) && defined(MODULE))
 static unsigned int snd_soc_8_16_read_i2c(struct snd_soc_codec *codec,
                                          unsigned int r)
 {
@@ -200,7 +200,7 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
                break;
 
        case SND_SOC_I2C:
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+#if defined(CONFIG_I2C) || (defined(CONFIG_I2C_MODULE) && defined(MODULE))
                codec->hw_write = (hw_write_t)i2c_master_send;
 #endif
                if (io_types[i].i2c_read)