summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Osciak <pawel@osciak.com>2011-03-20 19:26:41 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-22 04:55:08 -0300
commit5db2c3ba4de8489a7a064bac463bb8af2c7a1ae4 (patch)
treed1dbaabc2a6133ca962ed90e3af8dd0e94488702
parent4ffabdb35ad59fdb8cb6ad3ff4733694ff0dfc35 (diff)
[media] vb2: Handle return value from start_streaming callback
Fix vb2 not handling return value from start_streaming() callback. Signed-off-by: Pawel Osciak <pawel@osciak.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/videobuf2-core.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/media/video/videobuf2-core.c b/drivers/media/video/videobuf2-core.c
index 8c6f04bc4d8..6698c77e0f6 100644
--- a/drivers/media/video/videobuf2-core.c
+++ b/drivers/media/video/videobuf2-core.c
@@ -1111,6 +1111,7 @@ EXPORT_SYMBOL_GPL(vb2_dqbuf);
int vb2_streamon(struct vb2_queue *q, enum v4l2_buf_type type)
{
struct vb2_buffer *vb;
+ int ret;
if (q->fileio) {
dprintk(1, "streamon: file io in progress\n");
@@ -1138,12 +1139,16 @@ int vb2_streamon(struct vb2_queue *q, enum v4l2_buf_type type)
}
}
- q->streaming = 1;
-
/*
* Let driver notice that streaming state has been enabled.
*/
- call_qop(q, start_streaming, q);
+ ret = call_qop(q, start_streaming, q);
+ if (ret) {
+ dprintk(1, "streamon: driver refused to start streaming\n");
+ return ret;
+ }
+
+ q->streaming = 1;
/*
* If any buffers were queued before streamon,