[alsa-devel] [PATCH 00/11] codecs: Use IS_ENABLED() macro
From: Fabio Estevam fabio.estevam@freescale.com
Using the IS_ENABLED() macro can make the code shorter and simpler.
Mark,
There are still more ocurrences that can be converted to IS_ENABLED.
If you are happy with this series I will send another one with the remaining pieces.
From: Fabio Estevam fabio.estevam@freescale.com
Using the IS_ENABLED() macro can make the code shorter and simpler.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- sound/soc/codecs/wm8962.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index 543c5c2..07da601 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c @@ -74,7 +74,7 @@ struct wm8962_priv { struct regulator_bulk_data supplies[WM8962_NUM_SUPPLIES]; struct notifier_block disable_nb[WM8962_NUM_SUPPLIES];
-#if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE) +#if IS_ENABLED(CONFIG_INPUT) struct input_dev *beep; struct work_struct beep_work; int beep_rate; @@ -3108,7 +3108,7 @@ int wm8962_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack) } EXPORT_SYMBOL_GPL(wm8962_mic_detect);
-#if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE) +#if IS_ENABLED(CONFIG_INPUT) static int beep_rates[] = { 500, 1000, 2000, 4000, };
From: Fabio Estevam fabio.estevam@freescale.com
Using the IS_ENABLED() macro can make the code shorter and simpler.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- sound/soc/soc-io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/soc-io.c b/sound/soc/soc-io.c index 4f11d23..aa886cc 100644 --- a/sound/soc/soc-io.c +++ b/sound/soc/soc-io.c @@ -99,14 +99,14 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, config.val_bits = data_bits;
switch (control) { -#if defined(CONFIG_REGMAP_I2C) || defined(CONFIG_REGMAP_I2C_MODULE) +#if IS_ENABLED(CONFIG_REGMAP_I2C) case SND_SOC_I2C: codec->control_data = regmap_init_i2c(to_i2c_client(codec->dev), &config); break; #endif
-#if defined(CONFIG_REGMAP_SPI) || defined(CONFIG_REGMAP_SPI_MODULE) +#if IS_ENABLED(CONFIG_REGMAP_SPI) case SND_SOC_SPI: codec->control_data = regmap_init_spi(to_spi_device(codec->dev), &config);
From: Fabio Estevam fabio.estevam@freescale.com
Using the IS_ENABLED() macro can make the code shorter and simpler.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- sound/soc/codecs/ad193x.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/ad193x.c b/sound/soc/codecs/ad193x.c index aea7e52..12c27eb 100644 --- a/sound/soc/codecs/ad193x.c +++ b/sound/soc/codecs/ad193x.c @@ -413,7 +413,7 @@ static struct spi_driver ad193x_spi_driver = { }; #endif
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C)
static const struct regmap_config ad193x_i2c_regmap_config = { .val_bits = 8, @@ -470,7 +470,7 @@ static int __init ad193x_modinit(void) { int ret;
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) ret = i2c_add_driver(&ad193x_i2c_driver); if (ret != 0) { printk(KERN_ERR "Failed to register AD193X I2C driver: %d\n", @@ -495,7 +495,7 @@ static void __exit ad193x_modexit(void) spi_unregister_driver(&ad193x_spi_driver); #endif
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) i2c_del_driver(&ad193x_i2c_driver); #endif }
2013/11/21 Fabio Estevam festevam@gmail.com:
From: Fabio Estevam fabio.estevam@freescale.com
Using the IS_ENABLED() macro can make the code shorter and simpler.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com
sound/soc/codecs/ad193x.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/ad193x.c b/sound/soc/codecs/ad193x.c index aea7e52..12c27eb 100644 --- a/sound/soc/codecs/ad193x.c +++ b/sound/soc/codecs/ad193x.c @@ -413,7 +413,7 @@ static struct spi_driver ad193x_spi_driver = { }; #endif
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C)
static const struct regmap_config ad193x_i2c_regmap_config = { .val_bits = 8, @@ -470,7 +470,7 @@ static int __init ad193x_modinit(void) { int ret;
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) ret = i2c_add_driver(&ad193x_i2c_driver); if (ret != 0) { printk(KERN_ERR "Failed to register AD193X I2C driver: %d\n", @@ -495,7 +495,7 @@ static void __exit ad193x_modexit(void) spi_unregister_driver(&ad193x_spi_driver); #endif
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) i2c_del_driver(&ad193x_i2c_driver); #endif }
Acked-by: Scott Jiang scott.jiang.linux@gmail.com
From: Fabio Estevam fabio.estevam@freescale.com
Using the IS_ENABLED() macro can make the code shorter and simpler.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- sound/soc/codecs/adav80x.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/adav80x.c b/sound/soc/codecs/adav80x.c index 14a7c16..f7bf455 100644 --- a/sound/soc/codecs/adav80x.c +++ b/sound/soc/codecs/adav80x.c @@ -939,7 +939,7 @@ static struct spi_driver adav80x_spi_driver = { }; #endif
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) static const struct regmap_config adav80x_i2c_regmap_config = { .val_bits = 8, .pad_bits = 1, @@ -985,7 +985,7 @@ static int __init adav80x_init(void) { int ret = 0;
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) ret = i2c_add_driver(&adav80x_i2c_driver); if (ret) return ret; @@ -1001,7 +1001,7 @@ module_init(adav80x_init);
static void __exit adav80x_exit(void) { -#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) i2c_del_driver(&adav80x_i2c_driver); #endif #if defined(CONFIG_SPI_MASTER)
From: Fabio Estevam fabio.estevam@freescale.com
Using the IS_ENABLED() macro can make the code shorter and simpler.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- sound/soc/codecs/adav80x.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/adav80x.c b/sound/soc/codecs/adav80x.c index 14a7c16..f7bf455 100644 --- a/sound/soc/codecs/adav80x.c +++ b/sound/soc/codecs/adav80x.c @@ -939,7 +939,7 @@ static struct spi_driver adav80x_spi_driver = { }; #endif
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) static const struct regmap_config adav80x_i2c_regmap_config = { .val_bits = 8, .pad_bits = 1, @@ -985,7 +985,7 @@ static int __init adav80x_init(void) { int ret = 0;
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) ret = i2c_add_driver(&adav80x_i2c_driver); if (ret) return ret; @@ -1001,7 +1001,7 @@ module_init(adav80x_init);
static void __exit adav80x_exit(void) { -#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) i2c_del_driver(&adav80x_i2c_driver); #endif #if defined(CONFIG_SPI_MASTER)
From: Fabio Estevam fabio.estevam@freescale.com
Using the IS_ENABLED() macro can make the code shorter and simpler.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- sound/soc/codecs/ak4642.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c index 090d499..2f861c9 100644 --- a/sound/soc/codecs/ak4642.c +++ b/sound/soc/codecs/ak4642.c @@ -511,7 +511,7 @@ static struct snd_soc_codec_driver soc_codec_dev_ak4648 = { .num_dapm_routes = ARRAY_SIZE(ak4642_intercon), };
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) static struct of_device_id ak4642_of_match[]; static int ak4642_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) @@ -576,7 +576,7 @@ static struct i2c_driver ak4642_i2c_driver = { static int __init ak4642_modinit(void) { int ret = 0; -#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) ret = i2c_add_driver(&ak4642_i2c_driver); #endif return ret; @@ -586,7 +586,7 @@ module_init(ak4642_modinit);
static void __exit ak4642_exit(void) { -#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) i2c_del_driver(&ak4642_i2c_driver); #endif
From: Fabio Estevam fabio.estevam@freescale.com
Using the IS_ENABLED() macro can make the code shorter and simpler.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- sound/soc/codecs/wm8728.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/wm8728.c b/sound/soc/codecs/wm8728.c index c6a292d..cd89033 100644 --- a/sound/soc/codecs/wm8728.c +++ b/sound/soc/codecs/wm8728.c @@ -320,7 +320,7 @@ static struct spi_driver wm8728_spi_driver = { }; #endif /* CONFIG_SPI_MASTER */
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) static int wm8728_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { @@ -371,7 +371,7 @@ static struct i2c_driver wm8728_i2c_driver = { static int __init wm8728_modinit(void) { int ret = 0; -#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) ret = i2c_add_driver(&wm8728_i2c_driver); if (ret != 0) { printk(KERN_ERR "Failed to register wm8728 I2C driver: %d\n", @@ -391,7 +391,7 @@ module_init(wm8728_modinit);
static void __exit wm8728_exit(void) { -#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) i2c_del_driver(&wm8728_i2c_driver); #endif #if defined(CONFIG_SPI_MASTER)
On Wed, Nov 20, 2013 at 03:37:47PM -0200, Fabio Estevam wrote:
From: Fabio Estevam fabio.estevam@freescale.com
Using the IS_ENABLED() macro can make the code shorter and simpler.
Applied, thanks.
From: Fabio Estevam fabio.estevam@freescale.com
Using the IS_ENABLED() macro can make the code shorter and simpler.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- sound/soc/codecs/wm8711.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/wm8711.c b/sound/soc/codecs/wm8711.c index 5b428b0..d99f948 100644 --- a/sound/soc/codecs/wm8711.c +++ b/sound/soc/codecs/wm8711.c @@ -469,7 +469,7 @@ static struct spi_driver wm8711_spi_driver = { }; #endif /* CONFIG_SPI_MASTER */
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) static int wm8711_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) { @@ -520,7 +520,7 @@ static struct i2c_driver wm8711_i2c_driver = { static int __init wm8711_modinit(void) { int ret; -#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) ret = i2c_add_driver(&wm8711_i2c_driver); if (ret != 0) { printk(KERN_ERR "Failed to register WM8711 I2C driver: %d\n", @@ -540,7 +540,7 @@ module_init(wm8711_modinit);
static void __exit wm8711_exit(void) { -#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) i2c_del_driver(&wm8711_i2c_driver); #endif #if defined(CONFIG_SPI_MASTER)
From: Fabio Estevam fabio.estevam@freescale.com
Using the IS_ENABLED() macro can make the code shorter and simpler.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- sound/soc/codecs/wm8580.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c index 08a414b..318989a 100644 --- a/sound/soc/codecs/wm8580.c +++ b/sound/soc/codecs/wm8580.c @@ -941,7 +941,7 @@ static const struct regmap_config wm8580_regmap = { .volatile_reg = wm8580_volatile, };
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) static int wm8580_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { @@ -1003,7 +1003,7 @@ static int __init wm8580_modinit(void) { int ret = 0;
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) ret = i2c_add_driver(&wm8580_i2c_driver); if (ret != 0) { pr_err("Failed to register WM8580 I2C driver: %d\n", ret); @@ -1016,7 +1016,7 @@ module_init(wm8580_modinit);
static void __exit wm8580_exit(void) { -#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) i2c_del_driver(&wm8580_i2c_driver); #endif }
From: Fabio Estevam fabio.estevam@freescale.com
Using the IS_ENABLED() macro can make the code shorter and simpler.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- sound/soc/codecs/wm8523.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/wm8523.c b/sound/soc/codecs/wm8523.c index 139bf9a..74d106d 100644 --- a/sound/soc/codecs/wm8523.c +++ b/sound/soc/codecs/wm8523.c @@ -452,7 +452,7 @@ static const struct regmap_config wm8523_regmap = { .volatile_reg = wm8523_volatile_register, };
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) static int wm8523_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { @@ -555,7 +555,7 @@ static struct i2c_driver wm8523_i2c_driver = { static int __init wm8523_modinit(void) { int ret; -#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) ret = i2c_add_driver(&wm8523_i2c_driver); if (ret != 0) { printk(KERN_ERR "Failed to register WM8523 I2C driver: %d\n", @@ -568,7 +568,7 @@ module_init(wm8523_modinit);
static void __exit wm8523_exit(void) { -#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) i2c_del_driver(&wm8523_i2c_driver); #endif }
From: Fabio Estevam fabio.estevam@freescale.com
Using the IS_ENABLED() macro can make the code shorter and simpler.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- sound/soc/codecs/wm8510.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/wm8510.c b/sound/soc/codecs/wm8510.c index 6ed5433..7df7d45 100644 --- a/sound/soc/codecs/wm8510.c +++ b/sound/soc/codecs/wm8510.c @@ -684,7 +684,7 @@ static struct spi_driver wm8510_spi_driver = { }; #endif /* CONFIG_SPI_MASTER */
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) static int wm8510_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { @@ -735,7 +735,7 @@ static struct i2c_driver wm8510_i2c_driver = { static int __init wm8510_modinit(void) { int ret = 0; -#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) ret = i2c_add_driver(&wm8510_i2c_driver); if (ret != 0) { printk(KERN_ERR "Failed to register WM8510 I2C driver: %d\n", @@ -755,7 +755,7 @@ module_init(wm8510_modinit);
static void __exit wm8510_exit(void) { -#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) i2c_del_driver(&wm8510_i2c_driver); #endif #if defined(CONFIG_SPI_MASTER)
From: Fabio Estevam fabio.estevam@freescale.com
Using the IS_ENABLED() macro can make the code shorter and simpler.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- sound/soc/codecs/uda1380.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c index fd0a314..726df6d 100644 --- a/sound/soc/codecs/uda1380.c +++ b/sound/soc/codecs/uda1380.c @@ -794,7 +794,7 @@ static struct snd_soc_codec_driver soc_codec_dev_uda1380 = { .num_dapm_routes = ARRAY_SIZE(uda1380_dapm_routes), };
-#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) static int uda1380_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { @@ -840,7 +840,7 @@ static struct i2c_driver uda1380_i2c_driver = { static int __init uda1380_modinit(void) { int ret = 0; -#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#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); @@ -851,7 +851,7 @@ module_init(uda1380_modinit);
static void __exit uda1380_exit(void) { -#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) +#if IS_ENABLED(CONFIG_I2C) i2c_del_driver(&uda1380_i2c_driver); #endif }
On Wed, Nov 20, 2013 at 03:37:40PM -0200, Fabio Estevam wrote:
From: Fabio Estevam fabio.estevam@freescale.com
Using the IS_ENABLED() macro can make the code shorter and simpler.
Applied all, thanks, but please do remember to use appropriate subject lines for commits - you were missing ASoC here.
participants (3)
-
Fabio Estevam
-
Mark Brown
-
Scott Jiang