Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android
[firefly-linux-kernel-4.4.55.git] / drivers / media / v4l2-core / videobuf2-v4l2.c
index 27b4b9e7c0c2f63c65c0fdaa1f515fc949a4dee2..6c441be8f893d8e931825b63b810d67ae67a2864 100644 (file)
@@ -67,6 +67,11 @@ static int __verify_planes_array(struct vb2_buffer *vb, const struct v4l2_buffer
        return 0;
 }
 
+static int __verify_planes_array_core(struct vb2_buffer *vb, const void *pb)
+{
+       return __verify_planes_array(vb, pb);
+}
+
 /**
  * __verify_length() - Verify that the bytesused value for each plane fits in
  * the plane length and that the data offset doesn't exceed the bytesused value.
@@ -432,6 +437,7 @@ static int __fill_vb2_buffer(struct vb2_buffer *vb,
 }
 
 static const struct vb2_buf_ops v4l2_buf_ops = {
+       .verify_planes_array    = __verify_planes_array_core,
        .fill_user_buffer       = __fill_v4l2_buffer,
        .fill_vb2_buffer        = __fill_vb2_buffer,
        .set_timestamp          = __set_timestamp,
@@ -822,10 +828,10 @@ unsigned int vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait)
                return res | POLLERR;
 
        /*
-        * For output streams you can write as long as there are fewer buffers
-        * queued than there are buffers available.
+        * For output streams you can call write() as long as there are fewer
+        * buffers queued than there are buffers available.
         */
-       if (q->is_output && q->queued_count < q->num_buffers)
+       if (q->is_output && q->fileio && q->queued_count < q->num_buffers)
                return res | POLLOUT | POLLWRNORM;
 
        if (list_empty(&q->done_list)) {