]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
[media] xc5000: properly report i2c write failures
authorDevin Heitmueller <dheitmueller@kernellabs.com>
Tue, 7 Aug 2012 01:46:57 +0000 (22:46 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 9 Aug 2012 23:33:13 +0000 (20:33 -0300)
The logic as written would *never* actually return an error condition,
since the loop would run until the counter hit zero but the check was
for a value less than zero.

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/common/tuners/xc5000.c

index a3f775a2ccd7c37220f4025cca956676ab7e652f..7189e06fb35f0d4c263fa601079a2d14d65c29bd 100644 (file)
@@ -343,7 +343,7 @@ static int xc_write_reg(struct xc5000_priv *priv, u16 regAddr, u16 i2cData)
                        }
                }
        }
-       if (WatchDogTimer < 0)
+       if (WatchDogTimer <= 0)
                result = XC_RESULT_I2C_WRITE_FAILURE;
 
        return result;