Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 85c7c70b authored by Brandon Philips's avatar Brandon Philips Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (6274): V4L: vivi.c replace logic in vivi_poll with videobuf_poll_stream



Since vivi is using videobuf_read_stream() it can use videobuf_poll_stream()
now.

Signed-off-by: default avatarBrandon Philips <bphilips@suse.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent a326ae11
Loading
Loading
Loading
Loading
+2 −17
Original line number Diff line number Diff line
@@ -1111,29 +1111,14 @@ vivi_poll(struct file *file, struct poll_table_struct *wait)
{
	struct vivi_fh        *fh = file->private_data;
	struct vivi_buffer    *buf;
	struct videobuf_queue *q = &fh->vb_vidq;

	dprintk(1,"%s\n",__FUNCTION__);

	if (V4L2_BUF_TYPE_VIDEO_CAPTURE != fh->type)
		return POLLERR;

	if (res_get(fh->dev,fh)) {
		dprintk(1,"poll: mmap interface\n");
		/* streaming capture */
		if (list_empty(&fh->vb_vidq.stream))
			return POLLERR;
		buf = list_entry(fh->vb_vidq.stream.next,struct vivi_buffer,vb.stream);
	} else {
		dprintk(1,"poll: read() interface\n");
		/* read() capture */
		return videobuf_poll_stream(file, &fh->	vb_vidq,
					    wait);
	}
	poll_wait(file, &buf->vb.done, wait);
	if (buf->vb.state == STATE_DONE ||
	    buf->vb.state == STATE_ERROR)
		return POLLIN|POLLRDNORM;
	return 0;
	return videobuf_poll_stream(file, q, wait);
}

static int vivi_release(struct inode *inode, struct file *file)