aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/common
diff options
context:
space:
mode:
authorDevin Heitmueller <dheitmueller@kernellabs.com>2012-08-06 22:46:57 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-08-09 20:33:13 -0300
commit0a3dabb15ef9039188464647113398ed95400318 (patch)
tree42a47cc31b843ed8e1755587f867336ac07b37fb /drivers/media/common
parent[media] xc5000: add support for showing the SNR and gain in the debug output (diff)
downloadlinux-dev-0a3dabb15ef9039188464647113398ed95400318.tar.xz
linux-dev-0a3dabb15ef9039188464647113398ed95400318.zip
[media] xc5000: properly report i2c write failures
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>
Diffstat (limited to 'drivers/media/common')
-rw-r--r--drivers/media/common/tuners/xc5000.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/common/tuners/xc5000.c b/drivers/media/common/tuners/xc5000.c
index a3f775a2ccd7..7189e06fb35f 100644
--- a/drivers/media/common/tuners/xc5000.c
+++ b/drivers/media/common/tuners/xc5000.c
@@ -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;