From patchwork Sun Mar 20 23:31:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Osciak X-Patchwork-Id: 646931 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2KNVcQJ005219 for ; Sun, 20 Mar 2011 23:31:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751632Ab1CTXbh (ORCPT ); Sun, 20 Mar 2011 19:31:37 -0400 Received: from mail-iy0-f174.google.com ([209.85.210.174]:51910 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751480Ab1CTXbh (ORCPT ); Sun, 20 Mar 2011 19:31:37 -0400 Received: by iyb26 with SMTP id 26so5871761iyb.19 for ; Sun, 20 Mar 2011 16:31:36 -0700 (PDT) Received: by 10.42.135.2 with SMTP id n2mr5792779ict.251.1300663896328; Sun, 20 Mar 2011 16:31:36 -0700 (PDT) Received: from localhost.localdomain (c-24-4-33-58.hsd1.ca.comcast.net [24.4.33.58]) by mx.google.com with ESMTPS id g17sm1007589ibb.6.2011.03.20.16.31.34 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 20 Mar 2011 16:31:35 -0700 (PDT) From: Pawel Osciak To: linux-media@vger.kernel.org Cc: m.szyprowski@samsung.com, Pawel Osciak Subject: [PATCH 1/2] [media] vb2: vb2_poll() fix return values for file I/O mode Date: Sun, 20 Mar 2011 16:31:15 -0700 Message-Id: <1300663876-24712-1-git-send-email-pawel@osciak.com> X-Mailer: git-send-email 1.7.4.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sun, 20 Mar 2011 23:31:39 +0000 (UTC) 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. */