From patchwork Fri May 31 14:37:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 2644331 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id D51043FD4E for ; Fri, 31 May 2013 14:41:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755389Ab3EaOlM (ORCPT ); Fri, 31 May 2013 10:41:12 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:16700 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754985Ab3EaOlK (ORCPT ); Fri, 31 May 2013 10:41:10 -0400 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MNO007F83GLUYP0@mailout3.samsung.com> for linux-media@vger.kernel.org; Fri, 31 May 2013 23:41:09 +0900 (KST) X-AuditID: cbfee61b-b7f8e6d00000524c-f2-51a8b685368b Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id A6.42.21068.586B8A15; Fri, 31 May 2013 23:41:09 +0900 (KST) Received: from amdc1344.digital.local ([106.116.147.32]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MNO00BWU3ALE760@mmp1.samsung.com>; Fri, 31 May 2013 23:41:09 +0900 (KST) From: Sylwester Nawrocki To: linux-media@vger.kernel.org Cc: laurent.pinchart@ideasonboard.com, hj210.choi@samsung.com, arun.kk@samsung.com, shaik.ameer@samsung.com, kyungmin.park@samsung.com, Sylwester Nawrocki Subject: [REVIEW PATCH v2 07/11] exynos4-is: Remove WARN_ON() from __fimc_pipeline_close() Date: Fri, 31 May 2013 16:37:23 +0200 Message-id: <1370011047-11488-8-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1370011047-11488-1-git-send-email-s.nawrocki@samsung.com> References: <1370011047-11488-1-git-send-email-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupkluLIzCtJLcpLzFFi42I5/e+xgG7rthWBBme2CFp8PHWb1eLxxmvM Fmeb3rBbdE5cwm7Rs2Erq8XhN+2sFkce7mZ3YPeY3TGT1aNvyypGj8+b5AKYo7hsUlJzMstS i/TtErgyDj8sKfjPVfHrxDqWBsbZnF2MnBwSAiYSC75dZISwxSQu3FvP1sXIxSEksIhRYtfu tVBOB5PEua8T2UCq2AQMJXqP9oF1iAjISzzpvQFWxCywnVHizLJVzCAJYYEYiZ4dm5hAbBYB VYmprdvBbF4BN4k/J76xdjFyAK1TkJgzyQYkzCngLnH441Kw+UJAJUfb/7BPYORdwMiwilE0 tSC5oDgpPddIrzgxt7g0L10vOT93EyM4gJ5J72Bc1WBxiFGAg1GJh9dgxYpAIdbEsuLK3EOM EhzMSiK8+XOAQrwpiZVVqUX58UWlOanFhxilOViUxHkPtloHCgmkJ5akZqemFqQWwWSZODil Ghjr0i4c2ehs+nxispZzX+ylQvP2ZIUJ1V8tWthynyRcUNvizsu9dO+3Y5PevFyk4ft30taT Ew9mNdz3731jP4/pwXZz8dddrdqNibPyqnPrGFVYPvlq/89pcck5njZ176OHN99Kzz9Znvg0 pXDvrz4b+RktJx/P5F6TGhtv3ii4c2bQqcaLL7yVWIozEg21mIuKEwEAZXLIHAIAAA== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org It's not a critical error to call __fimc_pipeline_close() with missing sensor subdev entity. Replace WARN_ON() with pr_warn() and return 0 instead of -EINVAL to fix control flow in some conditions. Signed-off-by: Sylwester Nawrocki Signed-off-by: Kyungmin Park --- drivers/media/platform/exynos4-is/media-dev.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c index e95a6d5..973f8a9 100644 --- a/drivers/media/platform/exynos4-is/media-dev.c +++ b/drivers/media/platform/exynos4-is/media-dev.c @@ -220,16 +220,16 @@ static int __fimc_pipeline_close(struct exynos_media_pipeline *ep) struct fimc_pipeline *p = to_fimc_pipeline(ep); struct v4l2_subdev *sd = p ? p->subdevs[IDX_SENSOR] : NULL; struct fimc_md *fmd; - int ret = 0; - - if (WARN_ON(sd == NULL)) - return -EINVAL; + int ret; - if (p->subdevs[IDX_SENSOR]) { - ret = fimc_pipeline_s_power(p, 0); - fimc_md_set_camclk(sd, false); + if (sd == NULL) { + pr_warn("%s(): No sensor subdev\n", __func__); + return 0; } + ret = fimc_pipeline_s_power(p, 0); + fimc_md_set_camclk(sd, false); + fmd = entity_to_fimc_mdev(&sd->entity); /* Disable PXLASYNC clock if this pipeline includes FIMC-IS */