summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/gspca/spca561.c
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2008-09-02 12:02:50 +0200
committerJean-Francois Moine <moinejf@free.fr>2008-09-02 12:02:50 +0200
commitf718582c720ea5aed974cdbaf09c4abe8ed3764a (patch)
tree44cfd4c0d7599f1c536abcb9e256f5552d794e01 /linux/drivers/media/video/gspca/spca561.c
parent05a867e17e137e3eabac744773524c5c1abdc930 (diff)
downloadmediapointer-dvb-s2-f718582c720ea5aed974cdbaf09c4abe8ed3764a.tar.gz
mediapointer-dvb-s2-f718582c720ea5aed974cdbaf09c4abe8ed3764a.tar.bz2
gspca: After 'while (retry--) {...}', retry will be -1 but not 0.
From: Li Zefan <lizf@cn.fujitsu.com> Priority: high Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Diffstat (limited to 'linux/drivers/media/video/gspca/spca561.c')
-rw-r--r--linux/drivers/media/video/gspca/spca561.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/linux/drivers/media/video/gspca/spca561.c b/linux/drivers/media/video/gspca/spca561.c
index 4cc805c3e..b1329a149 100644
--- a/linux/drivers/media/video/gspca/spca561.c
+++ b/linux/drivers/media/video/gspca/spca561.c
@@ -223,11 +223,11 @@ static int i2c_read(struct gspca_dev *gspca_dev, __u16 reg, __u8 mode)
reg_w_val(gspca_dev->dev, 0x8804, 0x92);
reg_w_val(gspca_dev->dev, 0x8801, reg);
reg_w_val(gspca_dev->dev, 0x8802, (mode | 0x01));
- while (retry--) {
+ do {
reg_r(gspca_dev, 0x8803, 1);
if (!gspca_dev->usb_buf)
break;
- }
+ } while (--retry);
if (retry == 0)
return -1;
reg_r(gspca_dev, 0x8800, 1);