[media] vb2: vb2_poll() fix return values for file I/O mode
authorPawel Osciak <pawel@osciak.com>
Sun, 20 Mar 2011 21:17:34 +0000 (18:17 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 22 Mar 2011 07:55:07 +0000 (04:55 -0300)
poll() should be returning poll-specific error values, not E* errors.

Signed-off-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/videobuf2-core.c

index ce03225..8c6f04b 100644 (file)
@@ -1364,18 +1364,18 @@ unsigned int vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait)
        struct vb2_buffer *vb = NULL;
 
        /*
-        * Start file io emulator if streaming api has not been used yet.
+        * Start file I/O emulator only if streaming API has not been used yet.
         */
        if (q->num_buffers == 0 && q->fileio == NULL) {
                if (!V4L2_TYPE_IS_OUTPUT(q->type) && (q->io_modes & VB2_READ)) {
                        ret = __vb2_init_fileio(q, 1);
                        if (ret)
-                               return ret;
+                               return POLLERR;
                }
                if (V4L2_TYPE_IS_OUTPUT(q->type) && (q->io_modes & VB2_WRITE)) {
                        ret = __vb2_init_fileio(q, 0);
                        if (ret)
-                               return ret;
+                               return POLLERR;
                        /*
                         * Write to OUTPUT queue can be done immediately.
                         */