Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138066
b: refs/heads/master
c: 632fe9f
h: refs/heads/master
v: v3
  • Loading branch information
Oliver Endriss authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent bedd18d commit 2b91cec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7c9e34aaab50a6c8f69ce59816dd76a283090667
refs/heads/master: 632fe9fe440249642845675d97436c667cbbd21e
21 changes: 6 additions & 15 deletions trunk/drivers/media/common/saa7146_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ static int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg *m
int i = 0, count = 0;
__le32 *buffer = dev->d_i2c.cpu_addr;
int err = 0;
int address_err = 0;
int short_delay = 0;

if (mutex_lock_interruptible(&dev->i2c_lock))
Expand Down Expand Up @@ -333,17 +332,10 @@ static int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg *m
i2c address probing, however, and address errors indicate that a
device is really *not* there. retrying in that case
increases the time the device needs to probe greatly, so
it should be avoided. because of the fact, that only
analog based cards use irq based i2c transactions (for dvb
cards, this screwes up other interrupt sources), we bail out
completely for analog cards after an address error and trust
the saa7146 address error detection. */
if ( -EREMOTEIO == err ) {
if( 0 != (SAA7146_USE_I2C_IRQ & dev->ext->flags)) {
goto out;
}
address_err++;
}
it should be avoided. So we bail out in irq mode after an
address error and trust the saa7146 address error detection. */
if (-EREMOTEIO == err && 0 != (SAA7146_USE_I2C_IRQ & dev->ext->flags))
goto out;
DEB_I2C(("error while sending message(s). starting again.\n"));
break;
}
Expand All @@ -358,10 +350,9 @@ static int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg *m

} while (err != num && retries--);

/* if every retry had an address error, exit right away */
if (address_err == retries) {
/* quit if any error occurred */
if (err != num)
goto out;
}

/* if any things had to be read, get the results */
if ( 0 != saa7146_i2c_msg_cleanup(msgs, num, buffer)) {
Expand Down

0 comments on commit 2b91cec

Please sign in to comment.