Commit bca14657 authored by Mark Brown's avatar Mark Brown

ASoC: Fix checkpatch issues in AD1938

Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 0c11f655
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
struct ad1938_priv { struct ad1938_priv {
struct snd_soc_codec codec; struct snd_soc_codec codec;
u8 reg_cache[AD1938_NUM_REGS]; u8 reg_cache[AD1938_NUM_REGS];
}; };
static struct snd_soc_codec *ad1938_codec; static struct snd_soc_codec *ad1938_codec;
...@@ -136,7 +135,7 @@ static int ad1938_set_tdm_slot(struct snd_soc_dai *dai, ...@@ -136,7 +135,7 @@ static int ad1938_set_tdm_slot(struct snd_soc_dai *dai,
dac_reg &= ~AD1938_DAC_CHAN_MASK; dac_reg &= ~AD1938_DAC_CHAN_MASK;
adc_reg &= ~AD1938_ADC_CHAN_MASK; adc_reg &= ~AD1938_ADC_CHAN_MASK;
switch(slots) { switch (slots) {
case 2: case 2:
dac_reg |= AD1938_DAC_2_CHANNELS << AD1938_DAC_CHAN_SHFT; dac_reg |= AD1938_DAC_2_CHANNELS << AD1938_DAC_CHAN_SHFT;
adc_reg |= AD1938_ADC_2_CHANNELS << AD1938_ADC_CHAN_SHFT; adc_reg |= AD1938_ADC_2_CHANNELS << AD1938_ADC_CHAN_SHFT;
...@@ -324,7 +323,7 @@ static int ad1938_write_reg(struct snd_soc_codec *codec, unsigned int reg, ...@@ -324,7 +323,7 @@ static int ad1938_write_reg(struct snd_soc_codec *codec, unsigned int reg,
u8 *reg_cache = codec->reg_cache; u8 *reg_cache = codec->reg_cache;
int ret = 0; int ret = 0;
if(value != reg_cache[reg]) { if (value != reg_cache[reg]) {
uint8_t buf[AD1938_SPI_BUFLEN]; uint8_t buf[AD1938_SPI_BUFLEN];
struct spi_transfer t = { struct spi_transfer t = {
.tx_buf = buf, .tx_buf = buf,
...@@ -337,7 +336,8 @@ static int ad1938_write_reg(struct snd_soc_codec *codec, unsigned int reg, ...@@ -337,7 +336,8 @@ static int ad1938_write_reg(struct snd_soc_codec *codec, unsigned int reg,
buf[2] = value; buf[2] = value;
spi_message_init(&m); spi_message_init(&m);
spi_message_add_tail(&t, &m); spi_message_add_tail(&t, &m);
if((ret = spi_sync(codec->control_data, &m)) == 0) ret = spi_sync(codec->control_data, &m);
if (ret == 0)
reg_cache[reg] = value; reg_cache[reg] = value;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment