All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] decrement address_err as well as retries.
@ 2009-02-02 22:04 Roel Kluin
  0 siblings, 0 replies; only message in thread
From: Roel Kluin @ 2009-02-02 22:04 UTC (permalink / raw)
  To: michael; +Cc: linux-media

Since we want to determine whether every retry we had an address_err,
and we decrement retries, we should decrement address_err as well.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/media/common/saa7146_i2c.c b/drivers/media/common/saa7146_i2c.c
index c11da4d..2fac001 100644
--- a/drivers/media/common/saa7146_i2c.c
+++ b/drivers/media/common/saa7146_i2c.c
@@ -293,7 +293,7 @@ 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 address_err = retries;
 	int short_delay = 0;
 
 	if (mutex_lock_interruptible(&dev->i2c_lock))
@@ -342,7 +342,7 @@ static int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg *m
 					if( 0 != (SAA7146_USE_I2C_IRQ & dev->ext->flags)) {
 						goto out;
 					}
-					address_err++;
+					address_err--;
 				}
 				DEB_I2C(("error while sending message(s). starting again.\n"));
 				break;

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-02-02 22:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-02 22:04 [PATCH] decrement address_err as well as retries Roel Kluin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.