diff options
author | Jean Delvare <khali@linux-fr.org> | 2010-07-18 15:52:05 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-08 22:42:53 -0400 |
commit | 44835f197bf1e3f57464f23dfb239fef06cf89be (patch) | |
tree | 682720300f79287e3ec4c23acb86471ee6e2f351 /drivers | |
parent | f4acb3c4ccca74f5448354308f917e87ce83505a (diff) |
V4L/DVB: cx23885: Check for slave nack on all transactions
Don't just check for nacks on zero-length transactions. Check on
other transactions too.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/cx23885/cx23885-i2c.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/media/video/cx23885/cx23885-i2c.c b/drivers/media/video/cx23885/cx23885-i2c.c index 154c914ae16f..afb8d6f91d14 100644 --- a/drivers/media/video/cx23885/cx23885-i2c.c +++ b/drivers/media/video/cx23885/cx23885-i2c.c | |||
@@ -125,6 +125,10 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, | |||
125 | goto err; | 125 | goto err; |
126 | if (retval == 0) | 126 | if (retval == 0) |
127 | goto eio; | 127 | goto eio; |
128 | if (!i2c_slave_did_ack(i2c_adap)) { | ||
129 | retval = -ENXIO; | ||
130 | goto err; | ||
131 | } | ||
128 | if (i2c_debug) { | 132 | if (i2c_debug) { |
129 | printk(" <W %02x %02x", msg->addr << 1, msg->buf[0]); | 133 | printk(" <W %02x %02x", msg->addr << 1, msg->buf[0]); |
130 | if (!(ctrl & I2C_NOSTOP)) | 134 | if (!(ctrl & I2C_NOSTOP)) |
@@ -214,6 +218,10 @@ static int i2c_readbytes(struct i2c_adapter *i2c_adap, | |||
214 | goto err; | 218 | goto err; |
215 | if (retval == 0) | 219 | if (retval == 0) |
216 | goto eio; | 220 | goto eio; |
221 | if (cnt == 0 && !i2c_slave_did_ack(i2c_adap)) { | ||
222 | retval = -ENXIO; | ||
223 | goto err; | ||
224 | } | ||
217 | msg->buf[cnt] = cx_read(bus->reg_rdata) & 0xff; | 225 | msg->buf[cnt] = cx_read(bus->reg_rdata) & 0xff; |
218 | if (i2c_debug) { | 226 | if (i2c_debug) { |
219 | dprintk(1, " %02x", msg->buf[cnt]); | 227 | dprintk(1, " %02x", msg->buf[cnt]); |