Skip to content

Commit

Permalink
ASoC: uda1380: Remove #if IS_ENABLED(CONFIG_I2C)
Browse files Browse the repository at this point in the history
uda1380 driver doesn't work without CONFIG_I2C anyway.
Let's remove #if IS_ENABLED(CONFIG_I2C), and use module_i2c_driver().

And, this patch adds "depends on I2C" to Kconfig

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Kuninori Morimoto authored and Mark Brown committed Nov 18, 2016
1 parent 1001354 commit 4a5cf13
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
1 change: 1 addition & 0 deletions sound/soc/codecs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,7 @@ config SND_SOC_UDA134X

config SND_SOC_UDA1380
tristate
depends on I2C

config SND_SOC_WL1273
tristate
Expand Down
22 changes: 1 addition & 21 deletions sound/soc/codecs/uda1380.c
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,6 @@ static struct snd_soc_codec_driver soc_codec_dev_uda1380 = {
},
};

#if IS_ENABLED(CONFIG_I2C)
static int uda1380_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
{
Expand Down Expand Up @@ -815,27 +814,8 @@ static struct i2c_driver uda1380_i2c_driver = {
.remove = uda1380_i2c_remove,
.id_table = uda1380_i2c_id,
};
#endif

static int __init uda1380_modinit(void)
{
int ret = 0;
#if IS_ENABLED(CONFIG_I2C)
ret = i2c_add_driver(&uda1380_i2c_driver);
if (ret != 0)
pr_err("Failed to register UDA1380 I2C driver: %d\n", ret);
#endif
return ret;
}
module_init(uda1380_modinit);

static void __exit uda1380_exit(void)
{
#if IS_ENABLED(CONFIG_I2C)
i2c_del_driver(&uda1380_i2c_driver);
#endif
}
module_exit(uda1380_exit);
module_i2c_driver(uda1380_i2c_driver);

MODULE_AUTHOR("Giorgio Padrin");
MODULE_DESCRIPTION("Audio support for codec Philips UDA1380");
Expand Down

0 comments on commit 4a5cf13

Please sign in to comment.