Commit 18a87bec authored by Jean Delvare's avatar Jean Delvare Committed by Mauro Carvalho Chehab

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: default avatarJean Delvare <khali@linux-fr.org>
Signed-off-by: default avatarAndy Walls <awalls@md.metrocast.net>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 44835f19
...@@ -120,10 +120,7 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, ...@@ -120,10 +120,7 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap,
cx_write(bus->reg_wdata, wdata); cx_write(bus->reg_wdata, wdata);
cx_write(bus->reg_ctrl, ctrl); cx_write(bus->reg_ctrl, ctrl);
retval = i2c_wait_done(i2c_adap); if (!i2c_wait_done(i2c_adap))
if (retval < 0)
goto err;
if (retval == 0)
goto eio; goto eio;
if (!i2c_slave_did_ack(i2c_adap)) { if (!i2c_slave_did_ack(i2c_adap)) {
retval = -ENXIO; retval = -ENXIO;
...@@ -149,10 +146,7 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap, ...@@ -149,10 +146,7 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap,
cx_write(bus->reg_wdata, wdata); cx_write(bus->reg_wdata, wdata);
cx_write(bus->reg_ctrl, ctrl); cx_write(bus->reg_ctrl, ctrl);
retval = i2c_wait_done(i2c_adap); if (!i2c_wait_done(i2c_adap))
if (retval < 0)
goto err;
if (retval == 0)
goto eio; goto eio;
if (i2c_debug) { if (i2c_debug) {
dprintk(1, " %02x", msg->buf[cnt]); dprintk(1, " %02x", msg->buf[cnt]);
...@@ -213,10 +207,7 @@ static int i2c_readbytes(struct i2c_adapter *i2c_adap, ...@@ -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_addr, msg->addr << 25);
cx_write(bus->reg_ctrl, ctrl); cx_write(bus->reg_ctrl, ctrl);
retval = i2c_wait_done(i2c_adap); if (!i2c_wait_done(i2c_adap))
if (retval < 0)
goto err;
if (retval == 0)
goto eio; goto eio;
if (cnt == 0 && !i2c_slave_did_ack(i2c_adap)) { if (cnt == 0 && !i2c_slave_did_ack(i2c_adap)) {
retval = -ENXIO; retval = -ENXIO;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment