From 2ff4f7e679d65787de5a6b0099b0786bbe8dc202 Mon Sep 17 00:00:00 2001 From: Michael Hunold Date: Wed, 26 Nov 2003 13:27:21 +0000 Subject: - i2c timeout fix by Gerd Knorr --- linux/drivers/media/common/saa7146_i2c.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'linux/drivers') diff --git a/linux/drivers/media/common/saa7146_i2c.c b/linux/drivers/media/common/saa7146_i2c.c index 5db9ef621..699fedd32 100644 --- a/linux/drivers/media/common/saa7146_i2c.c +++ b/linux/drivers/media/common/saa7146_i2c.c @@ -186,7 +186,7 @@ static int saa7146_i2c_writeout(struct saa7146_dev *dev, u32* dword, int short_d { 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 saa7146_dev *dev, u32* dword, int short_d 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 saa7146_dev *dev, u32* dword, int short_d 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...) */ -- cgit v1.2.3