Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 366552
b: refs/heads/master
c: 7f6301d
h: refs/heads/master
v: v3
  • Loading branch information
Frank Schaefer authored and Mauro Carvalho Chehab committed Mar 18, 2013
1 parent 1a3c7fa commit 0368159
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 195281d0dc6a2fc1824d5da9abd2924bce0fa698
refs/heads/master: 7f6301d1257505d35e87ef1cb8eeee268e63a123
22 changes: 11 additions & 11 deletions trunk/drivers/media/usb/em28xx/em28xx-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,18 +227,18 @@ static int em28xx_i2c_recv_bytes(struct em28xx *dev, u16 addr, u8 *buf, u16 len)

/* Read data from i2c device */
ret = dev->em28xx_read_reg_req_len(dev, 2, addr, buf, len);
if (ret != len) {
if (ret < 0) {
em28xx_warn("reading from i2c device at 0x%x failed "
"(error=%i)\n", addr, ret);
return ret;
} else {
em28xx_warn("%i bytes requested from i2c device at "
"0x%x, but %i bytes received\n",
len, addr, ret);
return -EIO;
}
if (ret < 0) {
em28xx_warn("reading from i2c device at 0x%x failed (error=%i)\n",
addr, ret);
return ret;
}
/* NOTE: some devices with two i2c busses have the bad habit to return 0
* bytes if we are on bus B AND there was no write attempt to the
* specified slave address before AND no device is present at the
* requested slave address.
* Anyway, the next check will fail with -ENODEV in this case, so avoid
* spamming the system log on device probing and do nothing here.
*/

/* Check success of the i2c operation */
ret = dev->em28xx_read_reg(dev, 0x05);
Expand Down

0 comments on commit 0368159

Please sign in to comment.