/* Simple function to wait for a given 8-bit value to be returned from a reg_read call. Returns: negative is error or timeout, zero is success.  */
static int reg_r_wait(struct gspca_dev *gspca_dev, __u16 reg, __u16 index, __u16 value)
/* Simple function to wait for a given 8-bit value to be returned from a reg_read call. Returns: negative is error or timeout, zero is success.  */
static int reg_r_wait(struct gspca_dev *gspca_dev, __u16 reg, __u16 index, __u16 value)
{
	int ret, cnt = 20;
	while (--cnt > 0) {
		ret = reg_r_12(gspca_dev, reg, index, 1);
		if (ret == value)
			return 0;
		msleep(50);
	}
	return -EIO;
}