Commit 1cff399ecd9125d8e6a634a1957be1aeb3195a12

Authored by Brian Waters
Committed by Takashi Iwai
1 parent 96d9e9c039

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>

Showing 1 changed file with 12 additions and 6 deletions Side-by-side Diff

... ... @@ -98,7 +98,8 @@
98 98 bus->master = master;
99 99 }
100 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 103 snd_i2c_bus_free(bus);
103 104 return err;
104 105 }
... ... @@ -246,7 +247,8 @@
246 247  
247 248 for (i = 7; i >= 0; i--)
248 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 252 return err;
251 253 return 0;
252 254 }
253 255  
... ... @@ -278,12 +280,14 @@
278 280 if (device->flags & SND_I2C_DEVICE_ADDRTEN)
279 281 return -EIO; /* not yet implemented */
280 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 285 snd_i2c_bit_hw_stop(bus);
283 286 return err;
284 287 }
285 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 291 snd_i2c_bit_hw_stop(bus);
288 292 return err;
289 293 }
290 294  
... ... @@ -302,12 +306,14 @@
302 306 if (device->flags & SND_I2C_DEVICE_ADDRTEN)
303 307 return -EIO; /* not yet implemented */
304 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 311 snd_i2c_bit_hw_stop(bus);
307 312 return err;
308 313 }
309 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 317 snd_i2c_bit_hw_stop(bus);
312 318 return err;
313 319 }