aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/cx23885/cx23885-i2c.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/media/video/cx23885/cx23885-i2c.c b/drivers/media/video/cx23885/cx23885-i2c.c
index afb8d6f91d14..1a391486e551 100644
--- a/drivers/media/video/cx23885/cx23885-i2c.c
+++ b/drivers/media/video/cx23885/cx23885-i2c.c
@@ -120,10 +120,7 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap,
120 cx_write(bus->reg_wdata, wdata); 120 cx_write(bus->reg_wdata, wdata);
121 cx_write(bus->reg_ctrl, ctrl); 121 cx_write(bus->reg_ctrl, ctrl);
122 122
123 retval = i2c_wait_done(i2c_adap); 123 if (!i2c_wait_done(i2c_adap))
124 if (retval < 0)
125 goto err;
126 if (retval == 0)
127 goto eio; 124 goto eio;
128 if (!i2c_slave_did_ack(i2c_adap)) { 125 if (!i2c_slave_did_ack(i2c_adap)) {
129 retval = -ENXIO; 126 retval = -ENXIO;
@@ -149,10 +146,7 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap,
149 cx_write(bus->reg_wdata, wdata); 146 cx_write(bus->reg_wdata, wdata);
150 cx_write(bus->reg_ctrl, ctrl); 147 cx_write(bus->reg_ctrl, ctrl);
151 148
152 retval = i2c_wait_done(i2c_adap); 149 if (!i2c_wait_done(i2c_adap))
153 if (retval < 0)
154 goto err;
155 if (retval == 0)
156 goto eio; 150 goto eio;
157 if (i2c_debug) { 151 if (i2c_debug) {
158 dprintk(1, " %02x", msg->buf[cnt]); 152 dprintk(1, " %02x", msg->buf[cnt]);
@@ -213,10 +207,7 @@ static int i2c_readbytes(struct i2c_adapter *i2c_adap,
213 cx_write(bus->reg_addr, msg->addr << 25); 207 cx_write(bus->reg_addr, msg->addr << 25);
214 cx_write(bus->reg_ctrl, ctrl); 208 cx_write(bus->reg_ctrl, ctrl);
215 209
216 retval = i2c_wait_done(i2c_adap); 210 if (!i2c_wait_done(i2c_adap))
217 if (retval < 0)
218 goto err;
219 if (retval == 0)
220 goto eio; 211 goto eio;
221 if (cnt == 0 && !i2c_slave_did_ack(i2c_adap)) { 212 if (cnt == 0 && !i2c_slave_did_ack(i2c_adap)) {
222 retval = -ENXIO; 213 retval = -ENXIO;