summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx23885
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2010-07-18 17:05:17 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-08 23:42:54 -0300
commit18a87becf85d50e7f3d547f1b7a75108b151374d (patch)
tree77fdcc6152e3e749d54a1a000eedaa70af60c567 /drivers/media/video/cx23885
parent44835f197bf1e3f57464f23dfb239fef06cf89be (diff)
downloadblackbird-op-linux-18a87becf85d50e7f3d547f1b7a75108b151374d.tar.gz
blackbird-op-linux-18a87becf85d50e7f3d547f1b7a75108b151374d.zip
V4L/DVB: cx23885: i2c_wait_done returns 0 or 1, don't check for < 0 return value
Function i2c_wait_done() never returns negative values, so there is no point in checking for them. 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/media/video/cx23885')
-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,
cx_write(bus->reg_wdata, wdata);
cx_write(bus->reg_ctrl, ctrl);
- retval = i2c_wait_done(i2c_adap);
- if (retval < 0)
- goto err;
- if (retval == 0)
+ if (!i2c_wait_done(i2c_adap))
goto eio;
if (!i2c_slave_did_ack(i2c_adap)) {
retval = -ENXIO;
@@ -149,10 +146,7 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap,
cx_write(bus->reg_wdata, wdata);
cx_write(bus->reg_ctrl, ctrl);
- retval = i2c_wait_done(i2c_adap);
- if (retval < 0)
- goto err;
- if (retval == 0)
+ if (!i2c_wait_done(i2c_adap))
goto eio;
if (i2c_debug) {
dprintk(1, " %02x", msg->buf[cnt]);
@@ -213,10 +207,7 @@ static int i2c_readbytes(struct i2c_adapter *i2c_adap,
cx_write(bus->reg_addr, msg->addr << 25);
cx_write(bus->reg_ctrl, ctrl);
- retval = i2c_wait_done(i2c_adap);
- if (retval < 0)
- goto err;
- if (retval == 0)
+ if (!i2c_wait_done(i2c_adap))
goto eio;
if (cnt == 0 && !i2c_slave_did_ack(i2c_adap)) {
retval = -ENXIO;
OpenPOWER on IntegriCloud