mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 23:53:32 +00:00
V4L/DVB (8881): gspca: After 'while (retry--) {...}', retry will be -1 but not 0.
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
748c7f80ac
commit
8561098ff1
2 changed files with 4 additions and 4 deletions
|
@ -731,13 +731,13 @@ static void cx11646_jpeg(struct gspca_dev*gspca_dev)
|
|||
reg_w_val(gspca_dev, 0x0000, 0x00);
|
||||
/* wait for completion */
|
||||
retry = 50;
|
||||
while (retry--) {
|
||||
do {
|
||||
reg_r(gspca_dev, 0x0002, 1);
|
||||
/* 0x07 until 0x00 */
|
||||
if (gspca_dev->usb_buf[0] == 0x00)
|
||||
break;
|
||||
reg_w_val(gspca_dev, 0x0053, 0x00);
|
||||
}
|
||||
} while (--retry);
|
||||
if (retry == 0)
|
||||
PDEBUG(D_ERR, "Damned Errors sending jpeg Table");
|
||||
/* send the qtable now */
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue