aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/mt9v011.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/media/video/mt9v011.c b/drivers/media/video/mt9v011.c
index cd5e119f40a5..58a619436783 100644
--- a/drivers/media/video/mt9v011.c
+++ b/drivers/media/video/mt9v011.c
@@ -71,15 +71,17 @@ static int mt9v011_read(struct v4l2_subdev *sd, unsigned char addr)
71 __be16 buffer; 71 __be16 buffer;
72 int rc, val; 72 int rc, val;
73 73
74 if (1 != (rc = i2c_master_send(c, &addr, 1))) 74 rc = i2c_master_send(c, &addr, 1);
75 if (rc != 1)
75 v4l2_dbg(0, debug, sd, 76 v4l2_dbg(0, debug, sd,
76 "i2c i/o error: rc == %d (should be 1)\n", rc); 77 "i2c i/o error: rc == %d (should be 1)\n", rc);
77 78
78 msleep(10); 79 msleep(10);
79 80
80 if (2 != (rc = i2c_master_recv(c, (char *)&buffer, 2))) 81 rc = i2c_master_recv(c, (char *)&buffer, 2);
82 if (rc != 2)
81 v4l2_dbg(0, debug, sd, 83 v4l2_dbg(0, debug, sd,
82 "i2c i/o error: rc == %d (should be 1)\n", rc); 84 "i2c i/o error: rc == %d (should be 2)\n", rc);
83 85
84 val = be16_to_cpu(buffer); 86 val = be16_to_cpu(buffer);
85 87
@@ -101,7 +103,8 @@ static void mt9v011_write(struct v4l2_subdev *sd, unsigned char addr,
101 103
102 v4l2_dbg(2, debug, sd, 104 v4l2_dbg(2, debug, sd,
103 "mt9v011: writing 0x%02x 0x%04x\n", buffer[0], value); 105 "mt9v011: writing 0x%02x 0x%04x\n", buffer[0], value);
104 if (3 != (rc = i2c_master_send(c, buffer, 3))) 106 rc = i2c_master_send(c, &buffer, 3);
107 if (rc != 3)
105 v4l2_dbg(0, debug, sd, 108 v4l2_dbg(0, debug, sd,
106 "i2c i/o error: rc == %d (should be 3)\n", rc); 109 "i2c i/o error: rc == %d (should be 3)\n", rc);
107} 110}