From: Gerd Knorr <kraxel@bytesex.org>

Below is a ObviouslyCorrect[tm] patch which fixes the i2c bus timeout
handling in the saa7146 driver.



 drivers/media/common/saa7146_i2c.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff -puN drivers/media/common/saa7146_i2c.c~dvb-i2c-timeout-fix drivers/media/common/saa7146_i2c.c
--- 25/drivers/media/common/saa7146_i2c.c~dvb-i2c-timeout-fix	2003-11-26 11:03:10.000000000 -0800
+++ 25-akpm/drivers/media/common/saa7146_i2c.c	2003-11-26 11:03:10.000000000 -0800
@@ -186,7 +186,7 @@ static int saa7146_i2c_writeout(struct s
 {
 	u32 status = 0, mc2 = 0;
 	int trial = 0;
-	int timeout;
+	unsigned long timeout;
 
 	/* write out i2c-command */
 	DEB_I2C(("before: 0x%08x (status: 0x%08x), %d\n",*dword,saa7146_read(dev, I2C_STATUS), dev->i2c_op));
@@ -218,7 +218,7 @@ static int saa7146_i2c_writeout(struct s
 			if( 0 != mc2 ) {
 				break;
 			}
-			if (jiffies > timeout) {
+			if (time_after(jiffies,timeout)) {
 				printk(KERN_WARNING "saa7146_i2c_writeout: timed out waiting for MC2\n");
 				return -EIO;
 			}
@@ -233,7 +233,7 @@ static int saa7146_i2c_writeout(struct s
 			status = saa7146_i2c_status(dev);
 			if ((status & 0x3) != 1)
 				break;
-			if (jiffies > timeout) {
+			if (time_after(jiffies,timeout)) {
 				/* this is normal when probing the bus
 				 * (no answer from nonexisistant device...)
 				 */

_