[alsa-devel] [PATCH 2/6] ASoC: alc5632: Fix compile without CONFIG_I2C
Leon Romanovsky
leon at leon.nu
Wed Nov 16 11:06:59 CET 2011
Signed-off-by: Leon Romanovsky <leon at leon.nu>
---
sound/soc/codecs/alc5632.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/alc5632.c b/sound/soc/codecs/alc5632.c
index 42feae0..b72d467 100644
--- a/sound/soc/codecs/alc5632.c
+++ b/sound/soc/codecs/alc5632.c
@@ -1105,6 +1105,7 @@ static struct regmap_config alc5632_regmap = {
* low = 0x1a
* high = 0x1b
*/
+#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
static __devinit int alc5632_i2c_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
@@ -1203,24 +1204,27 @@ static struct i2c_driver alc5632_i2c_driver = {
.remove = __devexit_p(alc5632_i2c_remove),
.id_table = alc5632_i2c_table,
};
+#endif
static int __init alc5632_modinit(void)
{
- int ret;
-
+ int ret = 0;
+#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
ret = i2c_add_driver(&alc5632_i2c_driver);
if (ret != 0) {
printk(KERN_ERR "%s: can't add i2c driver", __func__);
return ret;
}
-
+#endif
return ret;
}
module_init(alc5632_modinit);
static void __exit alc5632_modexit(void)
{
+#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
i2c_del_driver(&alc5632_i2c_driver);
+#endif
}
module_exit(alc5632_modexit);
--
1.7.3.4
More information about the Alsa-devel
mailing list