diff mbox

[v3,18/24] em28xx: improve I2C timeout error message

Message ID 1388232976-20061-19-git-send-email-mchehab@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mauro Carvalho Chehab Dec. 28, 2013, 12:16 p.m. UTC
From: Mauro Carvalho Chehab <m.chehab@samsung.com>

Since sometimes em28xx is returning 0x02 or 0x04 at the I2C status
register, output what's the returned status:

[ 1090.939820] em2882/3 #0: write to i2c device at 0xc2 timed out (ret=0x04)
[ 1090.939826] xc2028 19-0061: Error on line 1290: -5
[ 1091.140136] em2882/3 #0: write to i2c device at 0xc2 timed out (ret=0x04)
[ 1091.140155] xc2028 19-0061: Error on line 1290: -5
[ 1091.828622] em2882/3 #0: write to i2c device at 0xc2 timed out (ret=0x02)
[ 1091.828625] xc2028 19-0061: i2c input error: rc = -5 (should be 2)
[ 1091.928731] em2882/3 #0: write to i2c device at 0xc2 timed out (ret=0x02)
[ 1091.928734] xc2028 19-0061: i2c input error: rc = -5 (should be 2)

As that may help to latter improve the code.

Also, as those errors are now present, remove that bogus comment that
only 0x00 and 0x10 values are present.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
---
 drivers/media/usb/em28xx/em28xx-i2c.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
diff mbox

Patch

diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c b/drivers/media/usb/em28xx/em28xx-i2c.c
index d972e2f67214..420fddf7da3a 100644
--- a/drivers/media/usb/em28xx/em28xx-i2c.c
+++ b/drivers/media/usb/em28xx/em28xx-i2c.c
@@ -209,11 +209,6 @@  retry:
 			return ret;
 		}
 		msleep(5);
-		/*
-		 * NOTE: do we really have to wait for success ?
-		 * Never seen anything else than 0x00 or 0x10
-		 * (even with high payload) ...
-		 */
 	}
 
 	if (ret == 0x10) {
@@ -221,7 +216,8 @@  retry:
 			    addr);
 		return -ENODEV;
 	}
-	em28xx_warn("write to i2c device at 0x%x timed out\n", addr);
+	em28xx_warn("write to i2c device at 0x%x timed out (ret=0x%02x)\n",
+		    addr, ret);
 	return -EIO;
 }