All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: linux-media@vger.kernel.org
Cc: hj210.choi@samsung.com, dh09.lee@samsung.com,
	a.hajda@samsung.com, shaik.ameer@samsung.com,
	arun.kk@samsung.com, Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>
Subject: [PATCH 13/13] exynos4-is: Remove WARN_ON() from __fimc_pipeline_close()
Date: Thu, 09 May 2013 17:36:45 +0200	[thread overview]
Message-ID: <1368113805-20233-14-git-send-email-s.nawrocki@samsung.com> (raw)
In-Reply-To: <1368113805-20233-1-git-send-email-s.nawrocki@samsung.com>

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 <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 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 bf932d7..beec27b 100644
--- a/drivers/media/platform/exynos4-is/media-dev.c
+++ b/drivers/media/platform/exynos4-is/media-dev.c
@@ -247,16 +247,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 */
-- 
1.7.9.5


      parent reply	other threads:[~2013-05-09 15:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-09 15:36 [PATCH RFC 00/13] Media link_notify behaviour change an exynos4-is updates Sylwester Nawrocki
2013-05-09 15:36 ` [PATCH 01/13] exynos4-is: Remove platform_device_id table at fimc-lite driver Sylwester Nawrocki
2013-05-09 15:36 ` [PATCH 02/13] exynos4-is: Correct querycap ioctl handling " Sylwester Nawrocki
2013-05-09 15:36 ` [PATCH 03/13] exynos4-is: Move common functions to a separate module Sylwester Nawrocki
2013-05-09 15:36 ` [PATCH 04/13] exynos4-is: Add struct exynos_video_entity Sylwester Nawrocki
2013-05-09 15:36 ` [PATCH 05/13] exynos4-is: Preserve state of controls between /dev/video open/close Sylwester Nawrocki
2013-05-09 15:36 ` [PATCH 06/13] exynos4-is: Media graph/video device locking rework Sylwester Nawrocki
2013-05-09 15:36 ` [PATCH 07/13] exynos4-is: Do not use asynchronous runtime PM in release fop Sylwester Nawrocki
2013-05-09 15:36 ` [PATCH 08/13] exynos4-is: Use common exynos_media_pipeline data structure Sylwester Nawrocki
2013-05-09 15:36 ` [PATCH 09/13] media: Change media device link_notify behaviour Sylwester Nawrocki
2013-05-28 17:39   ` Sylwester Nawrocki
2013-05-30  2:02   ` Laurent Pinchart
2013-05-31 10:02     ` Sylwester Nawrocki
2013-05-09 15:36 ` [PATCH 10/13] exynos4-is: Extend link_notify handler to support fimc-is/lite pipelines Sylwester Nawrocki
2013-05-09 15:36 ` [PATCH 11/13] exynos4-is: Fix sensor subdev -> FIMC notification setup Sylwester Nawrocki
2013-05-09 15:36 ` [PATCH 12/13] exynos4-is: Add locking at fimc(-lite) subdev unregistered handler Sylwester Nawrocki
2013-05-09 15:36 ` Sylwester Nawrocki [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1368113805-20233-14-git-send-email-s.nawrocki@samsung.com \
    --to=s.nawrocki@samsung.com \
    --cc=a.hajda@samsung.com \
    --cc=arun.kk@samsung.com \
    --cc=dh09.lee@samsung.com \
    --cc=hj210.choi@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=shaik.ameer@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.