" the device again to choose the read method"); 
" the device again to choose the read method\n"); 
em28xx_v4l2_read(struct file *filp, char __user * buf, size_t count,		 loff_t * f_pos){	struct em28xx_frame_t *f, *i;	unsigned long lock_flags;	int ret = 0;	struct em28xx *dev = filp->private_data;	if (down_interruptible(&dev->fileop_lock))		return -ERESTARTSYS;	if (dev->state & DEV_DISCONNECTED) {		em28xx_videodbg("device not present");		up(&dev->fileop_lock);		return -ENODEV;	}	if (dev->state & DEV_MISCONFIGURED) {		em28xx_videodbg("device misconfigured; close and open it again");		up(&dev->fileop_lock);		return -EIO;	}	if (dev->io == IO_MMAP) {		em28xx_videodbg ("IO method is set to mmap; close and open"				" the device again to choose the read method");		up(&dev->fileop_lock);		return -EINVAL;	}	if (dev->io == IO_NONE) {		if (!em28xx_request_buffers(dev, EM28XX_NUM_READ_FRAMES)) {			em28xx_errdev("read failed, not enough memory\n");			up(&dev->fileop_lock);			return -ENOMEM;		}		dev->io = IO_READ;		dev->stream = STREAM_ON;		em28xx_queue_unusedframes(dev);	}	if (!count) {		up(&dev->fileop_lock);		return 0;	}	if (list_empty(&dev->outqueue)) {		if (filp->f_flags & O_NONBLOCK) {			up(&dev->fileop_lock);			return -EAGAIN;		}		ret = wait_event_interruptible		    (dev->wait_frame,		     (!list_empty(&dev->outqueue)) ||		     (dev->state & DEV_DISCONNECTED));		if (ret) {			up(&dev->fileop_lock);			return ret;		}		if (dev->state & DEV_DISCONNECTED) {			up(&dev->fileop_lock);			return -ENODEV;		}	}	f = list_entry(dev->outqueue.prev, struct em28xx_frame_t, frame);	spin_lock_irqsave(&dev->queue_lock, lock_flags);	list_for_each_entry(i, &dev->outqueue, frame)	    i->state = F_UNUSED;	INIT_LIST_HEAD(&dev->outqueue);	spin_unlock_irqrestore(&dev->queue_lock, lock_flags);	em28xx_queue_unusedframes(dev);	if (count > f->buf.length)		count = f->buf.length;	if (copy_to_user(buf, f->bufmem, count)) {		up(&dev->fileop_lock);		return -EFAULT;	}	*f_pos += count;	up(&dev->fileop_lock);	return count;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/eac94356c8f9f7d3854ed0290a406b13bfe8df4c/em28xx-video.c/buggy/drivers/media/video/em28xx/em28xx-video.c