From patchwork Sun Mar 20 23:31:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Osciak X-Patchwork-Id: 646941 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 p2KNVfc5005259 for ; Sun, 20 Mar 2011 23:31:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751888Ab1CTXbk (ORCPT ); Sun, 20 Mar 2011 19:31:40 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:64126 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751752Ab1CTXbj (ORCPT ); Sun, 20 Mar 2011 19:31:39 -0400 Received: by iwn34 with SMTP id 34so5875650iwn.19 for ; Sun, 20 Mar 2011 16:31:39 -0700 (PDT) Received: by 10.42.95.1 with SMTP id d1mr403874icn.254.1300663898946; Sun, 20 Mar 2011 16:31:38 -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.37 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 20 Mar 2011 16:31:38 -0700 (PDT) From: Pawel Osciak To: linux-media@vger.kernel.org Cc: m.szyprowski@samsung.com, Pawel Osciak Subject: [PATCH 2/2] [media] vb2: Handle return value from start_streaming callback Date: Sun, 20 Mar 2011 16:31:16 -0700 Message-Id: <1300663876-24712-2-git-send-email-pawel@osciak.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1300663876-24712-1-git-send-email-pawel@osciak.com> References: <1300663876-24712-1-git-send-email-pawel@osciak.com> 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:42 +0000 (UTC) diff --git a/drivers/media/video/videobuf2-core.c b/drivers/media/video/videobuf2-core.c index 8c6f04b..6698c77 100644 --- a/drivers/media/video/videobuf2-core.c +++ b/drivers/media/video/videobuf2-core.c @@ -1111,6 +1111,7 @@ EXPORT_SYMBOL_GPL(vb2_dqbuf); int vb2_streamon(struct vb2_queue *q, enum v4l2_buf_type type) { struct vb2_buffer *vb; + int ret; if (q->fileio) { dprintk(1, "streamon: file io in progress\n"); @@ -1138,12 +1139,16 @@ int vb2_streamon(struct vb2_queue *q, enum v4l2_buf_type type) } } - q->streaming = 1; - /* * Let driver notice that streaming state has been enabled. */ - call_qop(q, start_streaming, q); + ret = call_qop(q, start_streaming, q); + if (ret) { + dprintk(1, "streamon: driver refused to start streaming\n"); + return ret; + } + + q->streaming = 1; /* * If any buffers were queued before streamon,