Skip to content

Commit

Permalink
[media] xc5000: properly report i2c write failures
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Devin Heitmueller authored and Mauro Carvalho Chehab committed Aug 9, 2012
1 parent 7c287f1 commit 0a3dabb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/common/tuners/xc5000.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0a3dabb

Please sign in to comment.