From patchwork Wed Dec 16 13:32:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 7861811 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0D3999F350 for ; Wed, 16 Dec 2015 13:35:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 39D0C20272 for ; Wed, 16 Dec 2015 13:35:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5C4BA201EF for ; Wed, 16 Dec 2015 13:35:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932965AbbLPNev (ORCPT ); Wed, 16 Dec 2015 08:34:51 -0500 Received: from nblzone-211-213.nblnetworks.fi ([83.145.211.213]:60599 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754550AbbLPNet (ORCPT ); Wed, 16 Dec 2015 08:34:49 -0500 Received: from lanttu.localdomain (unknown [192.168.15.166]) by hillosipuli.retiisi.org.uk (Postfix) with ESMTP id E8942600A3; Wed, 16 Dec 2015 15:34:45 +0200 (EET) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: laurent.pinchart@ideasonboard.com, mchehab@osg.samsung.com, hverkuil@xs4all.nl, javier@osg.samsung.com Subject: [PATCH v3 08/23] media: Use the new media graph walk interface Date: Wed, 16 Dec 2015 15:32:23 +0200 Message-Id: <1450272758-29446-9-git-send-email-sakari.ailus@iki.fi> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1450272758-29446-1-git-send-email-sakari.ailus@iki.fi> References: <1450272758-29446-1-git-send-email-sakari.ailus@iki.fi> 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 The media graph walk requires initialisation and cleanup soon. Update the users to perform the soon necessary API calls. Signed-off-by: Sakari Ailus --- drivers/media/media-entity.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c index d63204e..2232cb3 100644 --- a/drivers/media/media-entity.c +++ b/drivers/media/media-entity.c @@ -492,7 +492,13 @@ __must_check int media_entity_pipeline_start(struct media_entity *entity, mutex_lock(&mdev->graph_mutex); - media_entity_graph_walk_start(graph, entity); + ret = media_entity_graph_walk_init(&pipe->graph, mdev); + if (ret) { + mutex_unlock(&mdev->graph_mutex); + return ret; + } + + media_entity_graph_walk_start(&pipe->graph, entity); while ((entity = media_entity_graph_walk_next(graph))) { DECLARE_BITMAP(active, MEDIA_ENTITY_MAX_PADS); @@ -590,6 +596,8 @@ error: break; } + media_entity_graph_walk_cleanup(graph); + mutex_unlock(&mdev->graph_mutex); return ret; @@ -623,6 +631,8 @@ void media_entity_pipeline_stop(struct media_entity *entity) entity->pipe = NULL; } + media_entity_graph_walk_cleanup(graph); + mutex_unlock(&mdev->graph_mutex); } EXPORT_SYMBOL_GPL(media_entity_pipeline_stop);