[1/2] vb2: vb2_poll() fix return values for file I/O mode

Message ID 1300663876-24712-1-git-send-email-pawel@osciak.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

Pawel Osciak March 20, 2011, 11:31 p.m. UTC
  poll() should be returning poll-specific error values, not E* errors.

Signed-off-by: Pawel Osciak <pawel@osciak.com>
---
 drivers/media/video/videobuf2-core.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
  

Comments

Marek Szyprowski March 21, 2011, 7:56 a.m. UTC | #1
Hello,

On Monday, March 21, 2011 12:31 AM Pawel Osciak wrote:

> poll() should be returning poll-specific error values, not E* errors.
> 
> Signed-off-by: Pawel Osciak <pawel@osciak.com>

Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>

> ---
>  drivers/media/video/videobuf2-core.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/video/videobuf2-core.c b/drivers/media/video/videobuf2-core.c
> index ce03225..8c6f04b 100644
> --- a/drivers/media/video/videobuf2-core.c
> +++ b/drivers/media/video/videobuf2-core.c
> @@ -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.
>  			 */
> --
> 1.7.4.1

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  

Patch

diff --git a/drivers/media/video/videobuf2-core.c b/drivers/media/video/videobuf2-core.c
index ce03225..8c6f04b 100644
--- a/drivers/media/video/videobuf2-core.c
+++ b/drivers/media/video/videobuf2-core.c
@@ -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.
 			 */