]> Pileus Git - ~andy/linux/commitdiff
[media] vb2: Return 0 when streamon and streamoff are already on/off
authorRicardo Ribalda <ricardo.ribalda@gmail.com>
Fri, 8 Nov 2013 10:08:45 +0000 (07:08 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Mon, 9 Dec 2013 13:41:53 +0000 (11:41 -0200)
According to the doc:
If VIDIOC_STREAMON is called when streaming is already in progress,
or if VIDIOC_STREAMOFF is called when streaming is already stopped,
then the ioctl does nothing and 0 is returned.
The current implementation was returning -EINVAL instead.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/v4l2-core/videobuf2-core.c

index 57ba131f08ad9f19d899870f8d7ecf8998170f8a..e949a0e64be99b39f1c1bfb8420b9681fdb38a6e 100644 (file)
@@ -1697,8 +1697,8 @@ int vb2_streamon(struct vb2_queue *q, enum v4l2_buf_type type)
        }
 
        if (q->streaming) {
-               dprintk(1, "streamon: already streaming\n");
-               return -EBUSY;
+               dprintk(3, "streamon successful: already streaming\n");
+               return 0;
        }
 
        /*
@@ -1754,8 +1754,8 @@ int vb2_streamoff(struct vb2_queue *q, enum v4l2_buf_type type)
        }
 
        if (!q->streaming) {
-               dprintk(1, "streamoff: not streaming\n");
-               return -EINVAL;
+               dprintk(3, "streamoff successful: not streaming\n");
+               return 0;
        }
 
        /*