diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-20 09:41:44 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-20 09:41:44 -0700 |
commit | 7f06a8b26aba1dc03b42272dc0089a800372c575 (patch) | |
tree | 7c67198f83d069eb13fd417e022d111b7e4c82a1 /sound/i2c | |
parent | c3ad33c9bcb6616999953af76f16318120fe3691 (diff) | |
parent | d71f4cece4bd97d05592836202fc04ff2e7817e3 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (250 commits)
ALSA: hda: Storage class should be before const qualifier
ASoC: tpa6130a2: Remove CPVSS and HPVdd supplies
ASoC: tpa6130a2: Define output pins with SND_SOC_DAPM_OUTPUT
ASoC: sdp4430 - add sdp4430 pcm ops to DAI.
ASoC: TWL6040: Enable earphone path in codec
ASoC: SDP4430: Add support for Earphone speaker
ASoC: SDP4430: Add sdp4430 machine driver
ASoC: tlv320dac33: Avoid powering off while in BIAS_OFF
ASoC: tlv320dac33: Use dev_dbg in dac33_hard_power function
ALSA: sound/pci/asihpi: Use kzalloc
ALSA: hdmi - dont fail on extra nodes
ALSA: intelhdmi - add id for the CougarPoint chipset
ALSA: intelhdmi - user friendly codec name
ALSA: intelhdmi - add dependency on SND_DYNAMIC_MINORS
ALSA: asihpi: incorrect range check
ALSA: asihpi: testing the wrong variable
ALSA: es1688: add pedantic range checks
ARM: McBSP: Add support for omap4 in McBSP driver
ARM: McBSP: Fix request for irq in OMAP4
OMAP: McBSP: Add 32-bit mode support
...
Diffstat (limited to 'sound/i2c')
-rw-r--r-- | sound/i2c/i2c.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sound/i2c/i2c.c b/sound/i2c/i2c.c index 5c0c77dd01c3..eb7c7d05a7c1 100644 --- a/sound/i2c/i2c.c +++ b/sound/i2c/i2c.c @@ -98,7 +98,8 @@ int snd_i2c_bus_create(struct snd_card *card, const char *name, bus->master = master; } strlcpy(bus->name, name, sizeof(bus->name)); - if ((err = snd_device_new(card, SNDRV_DEV_BUS, bus, &ops)) < 0) { + err = snd_device_new(card, SNDRV_DEV_BUS, bus, &ops); + if (err < 0) { snd_i2c_bus_free(bus); return err; } @@ -246,7 +247,8 @@ static int snd_i2c_bit_sendbyte(struct snd_i2c_bus *bus, unsigned char data) for (i = 7; i >= 0; i--) snd_i2c_bit_send(bus, !!(data & (1 << i))); - if ((err = snd_i2c_bit_ack(bus)) < 0) + err = snd_i2c_bit_ack(bus); + if (err < 0) return err; return 0; } @@ -278,12 +280,14 @@ static int snd_i2c_bit_sendbytes(struct snd_i2c_device *device, if (device->flags & SND_I2C_DEVICE_ADDRTEN) return -EIO; /* not yet implemented */ snd_i2c_bit_start(bus); - if ((err = snd_i2c_bit_sendbyte(bus, device->addr << 1)) < 0) { + err = snd_i2c_bit_sendbyte(bus, device->addr << 1); + if (err < 0) { snd_i2c_bit_hw_stop(bus); return err; } while (count-- > 0) { - if ((err = snd_i2c_bit_sendbyte(bus, *bytes++)) < 0) { + err = snd_i2c_bit_sendbyte(bus, *bytes++); + if (err < 0) { snd_i2c_bit_hw_stop(bus); return err; } @@ -302,12 +306,14 @@ static int snd_i2c_bit_readbytes(struct snd_i2c_device *device, if (device->flags & SND_I2C_DEVICE_ADDRTEN) return -EIO; /* not yet implemented */ snd_i2c_bit_start(bus); - if ((err = snd_i2c_bit_sendbyte(bus, (device->addr << 1) | 1)) < 0) { + err = snd_i2c_bit_sendbyte(bus, (device->addr << 1) | 1); + if (err < 0) { snd_i2c_bit_hw_stop(bus); return err; } while (count-- > 0) { - if ((err = snd_i2c_bit_readbyte(bus, count == 0)) < 0) { + err = snd_i2c_bit_readbyte(bus, count == 0); + if (err < 0) { snd_i2c_bit_hw_stop(bus); return err; } |