From patchwork Fri Nov 8 10:08:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda Delgado X-Patchwork-Id: 3157161 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3011BBEEB2 for ; Fri, 8 Nov 2013 10:09:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 14EEB20375 for ; Fri, 8 Nov 2013 10:09:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 65BAB202F8 for ; Fri, 8 Nov 2013 10:09:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756617Ab3KHKIv (ORCPT ); Fri, 8 Nov 2013 05:08:51 -0500 Received: from mail-lb0-f176.google.com ([209.85.217.176]:37987 "EHLO mail-lb0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753610Ab3KHKIu (ORCPT ); Fri, 8 Nov 2013 05:08:50 -0500 Received: by mail-lb0-f176.google.com with SMTP id z5so1271732lbh.21 for ; Fri, 08 Nov 2013 02:08:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=7BOdASxvePOCpe5TkrfyfZcv8GLZ4ypuVQdgoHHHImI=; b=mahYHOsvi8VrIKoCXD4OhJxZG1HhuXrlTpfAgW8h179xjqmFPZjyMZ3Xcp4xulAI4e gTcIcw5DEnbHVQKVC0gLf+Id1MaN3o8CQ/CNO9ywqc56t9J1TAn7HhS1TduaoUBBphfR UNKfDMIUFNpYmcRFWfmk/Z4vzKPEAUmFWGbyWAK70Et2eP1YBeE9qaDJMDBb1nxmjgmR i8gLdIcxGRHf9zRB8AOiUe53yG1IaokRAFf4FgPA41AbIO8zg5/w6Djj0vvGzJXjw/7d DN9Az8TnK9jpZv7gb0hghouL3Sp2Z//nFcXDY39PHi9mbD7V3HsqCbvSRx82LmVEyCdr kzgA== X-Received: by 10.152.45.8 with SMTP id i8mr20790lam.44.1383905329285; Fri, 08 Nov 2013 02:08:49 -0800 (PST) Received: from neopili.qtec.com (0x4dd4aed9.adsl.cybercity.dk. [77.212.174.217]) by mx.google.com with ESMTPSA id vo1sm5973558lbb.1.2013.11.08.02.08.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Nov 2013 02:08:48 -0800 (PST) From: Ricardo Ribalda Delgado To: Pawel Osciak , Marek Szyprowski , Kyungmin Park , Mauro Carvalho Chehab , linux-media@vger.kernel.org (open list:VIDEOBUF2 FRAMEWORK), linux-kernel@vger.kernel.org (open list), sylvester.nawrocki@gmail.com, hverkuil@xs4all.nl Cc: Ricardo Ribalda Delgado Subject: [PATCH] vb2: Return 0 when streamon and streamoff are already on/off Date: Fri, 8 Nov 2013 11:08:45 +0100 Message-Id: <1383905325-6163-1-git-send-email-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 1.8.4.rc3 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP According to the doc: If VIDIOC_STREAMON is called when streaming is already in progress, or if VIDIOC_STREAMOFF is called when streaming is already stopped, then the ioctl does nothing and 0 is returned. The current implementation was returning -EINVAL instead. Signed-off-by: Ricardo Ribalda Delgado --- drivers/media/v4l2-core/videobuf2-core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c index c979946..a3c8eff 100644 --- a/drivers/media/v4l2-core/videobuf2-core.c +++ b/drivers/media/v4l2-core/videobuf2-core.c @@ -1695,8 +1695,8 @@ int vb2_streamon(struct vb2_queue *q, enum v4l2_buf_type type) } if (q->streaming) { - dprintk(1, "streamon: already streaming\n"); - return -EBUSY; + dprintk(3, "streamon successful: already streaming\n"); + return 0; } /* @@ -1752,8 +1752,8 @@ int vb2_streamoff(struct vb2_queue *q, enum v4l2_buf_type type) } if (!q->streaming) { - dprintk(1, "streamoff: not streaming\n"); - return -EINVAL; + dprintk(3, "streamoff successful: not streaming\n"); + return 0; } /*