Move source tree closer to the 2.6.32.17 mainline
/sound/soc/codecs/ak4104.c
blob:4d47bc4f74284764ec24434167371d3245009df8 -> blob:10c7550393ba93be17886d637aec0ad7aaacc362
--- sound/soc/codecs/ak4104.c
+++ sound/soc/codecs/ak4104.c
@@ -90,12 +90,10 @@ static int ak4104_spi_write(struct snd_s
if (reg >= codec->reg_cache_size)
return -EINVAL;
- reg &= AK4104_REG_MASK;
- reg |= AK4104_WRITE;
-
/* only write to the hardware if value has changed */
if (cache[reg] != value) {
- u8 tmp[2] = { reg, value };
+ u8 tmp[2] = { (reg & AK4104_REG_MASK) | AK4104_WRITE, value };
+
if (spi_write(spi, tmp, sizeof(tmp))) {
dev_err(&spi->dev, "SPI write failed\n");
return -EIO;