From patchwork Sun Apr 3 23:51:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Osciak X-Patchwork-Id: 6296 Return-path: Envelope-to: mchehab@pedra Delivery-date: Mon, 04 Apr 2011 08:32:30 -0300 Received: from mchehab by pedra with local (Exim 4.72) (envelope-from ) id 1Q6i1G-0001gY-4T for mchehab@pedra; Mon, 04 Apr 2011 08:32:30 -0300 Received: from casper.infradead.org [85.118.1.10] by pedra with IMAP (fetchmail-6.3.17) for (single-drop); Mon, 04 Apr 2011 08:32:30 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1Q6X55-0004qU-Fa; Sun, 03 Apr 2011 23:51:43 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753351Ab1DCXvf (ORCPT + 1 other); Sun, 3 Apr 2011 19:51:35 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:37753 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752896Ab1DCXvZ (ORCPT ); Sun, 3 Apr 2011 19:51:25 -0400 Received: by mail-iw0-f174.google.com with SMTP id 34so5256601iwn.19 for ; Sun, 03 Apr 2011 16:51:25 -0700 (PDT) Received: by 10.42.189.1 with SMTP id dc1mr847647icb.167.1301874685308; Sun, 03 Apr 2011 16:51:25 -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 19sm3318091ibx.52.2011.04.03.16.51.23 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 03 Apr 2011 16:51:24 -0700 (PDT) From: Pawel Osciak To: linux-media@vger.kernel.org Cc: m.szyprowski@samsung.com, s.nawrocki@samsung.com, g.liakhovetski@gmx.de, Pawel Osciak Subject: [PATCH 2/5] [media] vivi: adapt to the new stop_streaming() callback behavior Date: Sun, 3 Apr 2011 16:51:07 -0700 Message-Id: <1301874670-14833-3-git-send-email-pawel@osciak.com> X-Mailer: git-send-email 1.7.4.2 In-Reply-To: <1301874670-14833-1-git-send-email-pawel@osciak.com> References: <1301874670-14833-1-git-send-email-pawel@osciak.com> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Drivers are no longer required to call vb2_buffer_done() for all buffers they have queued in stop_streaming(). The return value for stop_streaming() has also been removed. Signed-off-by: Pawel Osciak --- drivers/media/video/vivi.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c index 2238a61..fcf11d7 100644 --- a/drivers/media/video/vivi.c +++ b/drivers/media/video/vivi.c @@ -627,8 +627,8 @@ static void vivi_stop_generating(struct vivi_dev *dev) } /* - * Typical driver might need to wait here until dma engine stops. - * In this case we can abort imiedetly, so it's just a noop. + * A typical driver might need to stop the hardware here and wait + * for any ongoing operations to finish. */ /* Release all active buffers */ @@ -636,7 +636,6 @@ static void vivi_stop_generating(struct vivi_dev *dev) struct vivi_buffer *buf; buf = list_entry(dma_q->active.next, struct vivi_buffer, list); list_del(&buf->list); - vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR); dprintk(dev, 2, "[%p/%d] done\n", buf, buf->vb.v4l2_buf.index); } } @@ -766,13 +765,11 @@ static int start_streaming(struct vb2_queue *vq) return vivi_start_generating(dev); } -/* abort streaming and wait for last buffer */ -static int stop_streaming(struct vb2_queue *vq) +static void stop_streaming(struct vb2_queue *vq) { struct vivi_dev *dev = vb2_get_drv_priv(vq); dprintk(dev, 1, "%s\n", __func__); vivi_stop_generating(dev); - return 0; } static void vivi_lock(struct vb2_queue *vq)