mirror of https://gitee.com/openkylin/linux.git
ASoC: soc-io: Use IS_ENABLED() macro
Using the IS_ENABLED() macro can make the code shorter and simpler. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
parent
6ce4eac1f6
commit
4d9127faa8
|
@ -99,14 +99,14 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
|
||||||
config.val_bits = data_bits;
|
config.val_bits = data_bits;
|
||||||
|
|
||||||
switch (control) {
|
switch (control) {
|
||||||
#if defined(CONFIG_REGMAP_I2C) || defined(CONFIG_REGMAP_I2C_MODULE)
|
#if IS_ENABLED(CONFIG_REGMAP_I2C)
|
||||||
case SND_SOC_I2C:
|
case SND_SOC_I2C:
|
||||||
codec->control_data = regmap_init_i2c(to_i2c_client(codec->dev),
|
codec->control_data = regmap_init_i2c(to_i2c_client(codec->dev),
|
||||||
&config);
|
&config);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_REGMAP_SPI) || defined(CONFIG_REGMAP_SPI_MODULE)
|
#if IS_ENABLED(CONFIG_REGMAP_SPI)
|
||||||
case SND_SOC_SPI:
|
case SND_SOC_SPI:
|
||||||
codec->control_data = regmap_init_spi(to_spi_device(codec->dev),
|
codec->control_data = regmap_init_spi(to_spi_device(codec->dev),
|
||||||
&config);
|
&config);
|
||||||
|
|
Loading…
Reference in New Issue