aboutsummaryrefslogtreecommitdiffstats
path: root/sound/i2c
diff options
context:
space:
mode:
authorBrian Waters <brianmwaters@gmail.com>2010-04-15 04:03:29 -0400
committerTakashi Iwai <tiwai@suse.de>2010-04-15 04:13:54 -0400
commit1cff399ecd9125d8e6a634a1957be1aeb3195a12 (patch)
tree0b1fa200761a2564a5a62129564791dca84cd0d1 /sound/i2c
parent96d9e9c039cf94280ba80b8d64714279cb6d26dd (diff)
ALSA: i2c: Fixed 8 checkpatch errors
Fixed 8 checkpatch errors (ERROR: do not use assignment in if condition) in sound/i2c/i2c.c. Signed-off-by: Brian Waters <brianmwaters@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/i2c')
-rw-r--r--sound/i2c/i2c.c18
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,
98 bus->master = master; 98 bus->master = master;
99 } 99 }
100 strlcpy(bus->name, name, sizeof(bus->name)); 100 strlcpy(bus->name, name, sizeof(bus->name));
101 if ((err = snd_device_new(card, SNDRV_DEV_BUS, bus, &ops)) < 0) { 101 err = snd_device_new(card, SNDRV_DEV_BUS, bus, &ops);
102 if (err < 0) {
102 snd_i2c_bus_free(bus); 103 snd_i2c_bus_free(bus);
103 return err; 104 return err;
104 } 105 }
@@ -246,7 +247,8 @@ static int snd_i2c_bit_sendbyte(struct snd_i2c_bus *bus, unsigned char data)
246 247
247 for (i = 7; i >= 0; i--) 248 for (i = 7; i >= 0; i--)
248 snd_i2c_bit_send(bus, !!(data & (1 << i))); 249 snd_i2c_bit_send(bus, !!(data & (1 << i)));
249 if ((err = snd_i2c_bit_ack(bus)) < 0) 250 err = snd_i2c_bit_ack(bus);
251 if (err < 0)
250 return err; 252 return err;
251 return 0; 253 return 0;
252} 254}
@@ -278,12 +280,14 @@ static int snd_i2c_bit_sendbytes(struct snd_i2c_device *device,
278 if (device->flags & SND_I2C_DEVICE_ADDRTEN) 280 if (device->flags & SND_I2C_DEVICE_ADDRTEN)
279 return -EIO; /* not yet implemented */ 281 return -EIO; /* not yet implemented */
280 snd_i2c_bit_start(bus); 282 snd_i2c_bit_start(bus);
281 if ((err = snd_i2c_bit_sendbyte(bus, device->addr << 1)) < 0) { 283 err = snd_i2c_bit_sendbyte(bus, device->addr << 1);
284 if (err < 0) {
282 snd_i2c_bit_hw_stop(bus); 285 snd_i2c_bit_hw_stop(bus);
283 return err; 286 return err;
284 } 287 }
285 while (count-- > 0) { 288 while (count-- > 0) {
286 if ((err = snd_i2c_bit_sendbyte(bus, *bytes++)) < 0) { 289 err = snd_i2c_bit_sendbyte(bus, *bytes++);
290 if (err < 0) {
287 snd_i2c_bit_hw_stop(bus); 291 snd_i2c_bit_hw_stop(bus);
288 return err; 292 return err;
289 } 293 }
@@ -302,12 +306,14 @@ static int snd_i2c_bit_readbytes(struct snd_i2c_device *device,
302 if (device->flags & SND_I2C_DEVICE_ADDRTEN) 306 if (device->flags & SND_I2C_DEVICE_ADDRTEN)
303 return -EIO; /* not yet implemented */ 307 return -EIO; /* not yet implemented */
304 snd_i2c_bit_start(bus); 308 snd_i2c_bit_start(bus);
305 if ((err = snd_i2c_bit_sendbyte(bus, (device->addr << 1) | 1)) < 0) { 309 err = snd_i2c_bit_sendbyte(bus, (device->addr << 1) | 1);
310 if (err < 0) {
306 snd_i2c_bit_hw_stop(bus); 311 snd_i2c_bit_hw_stop(bus);
307 return err; 312 return err;
308 } 313 }
309 while (count-- > 0) { 314 while (count-- > 0) {
310 if ((err = snd_i2c_bit_readbyte(bus, count == 0)) < 0) { 315 err = snd_i2c_bit_readbyte(bus, count == 0);
316 if (err < 0) {
311 snd_i2c_bit_hw_stop(bus); 317 snd_i2c_bit_hw_stop(bus);
312 return err; 318 return err;
313 } 319 }