diff mbox

[v2,2/3] v4l: videobuf: Add support for V4L2_BUF_FLAG_ERROR

Message ID 1270027947-28327-3-git-send-email-p.osciak@samsung.com (mailing list archive)
State Superseded
Headers show

Commit Message

Pawel Osciak March 31, 2010, 9:32 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/media/video/videobuf-core.c b/drivers/media/video/videobuf-core.c
index 63d7043..a9cfab6 100644
--- a/drivers/media/video/videobuf-core.c
+++ b/drivers/media/video/videobuf-core.c
@@ -665,6 +665,7 @@  int videobuf_dqbuf(struct videobuf_queue *q,
 {
 	struct videobuf_buffer *buf = NULL;
 	int retval;
+	int err_flag = 0;
 
 	MAGIC_CHECK(q->int_ops->magic, MAGIC_QTYPE_OPS);
 
@@ -679,7 +680,7 @@  int videobuf_dqbuf(struct videobuf_queue *q,
 	switch (buf->state) {
 	case VIDEOBUF_ERROR:
 		dprintk(1, "dqbuf: state is error\n");
-		retval = -EIO;
+		err_flag = V4L2_BUF_FLAG_ERROR;
 		CALL(q, sync, q, buf);
 		buf->state = VIDEOBUF_IDLE;
 		break;
@@ -696,6 +697,7 @@  int videobuf_dqbuf(struct videobuf_queue *q,
 	list_del(&buf->stream);
 	memset(b, 0, sizeof(*b));
 	videobuf_status(q, b, buf, q->type);
+	b->flags |= err_flag;
 done:
 	mutex_unlock(&q->vb_lock);
 	return retval;