From patchwork Thu Jun 3 13:35:23 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 104102 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o53DX045012098 for ; Thu, 3 Jun 2010 13:33:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754076Ab0FCNc7 (ORCPT ); Thu, 3 Jun 2010 09:32:59 -0400 Received: from perceval.irobotique.be ([92.243.18.41]:51344 "EHLO perceval.irobotique.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753992Ab0FCNc7 (ORCPT ); Thu, 3 Jun 2010 09:32:59 -0400 Received: from localhost.localdomain (115.110-65-87.adsl-dyn.isp.belgacom.be [87.65.110.115]) by perceval.irobotique.be (Postfix) with ESMTPSA id 8045735ABA; Thu, 3 Jun 2010 13:32:15 +0000 (UTC) From: Laurent Pinchart To: svarbanov@mm-sol.com Cc: linux-omap@vger.kernel.org, sakari.ailus@maxwell.research.nokia.com Subject: [linux-dali PATCH 1/1] omap3isp: video: Fix isp_video_far_end to return the correct entity Date: Thu, 3 Jun 2010 15:35:23 +0200 Message-Id: <1275572123-23516-1-git-send-email-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 1.6.4.4 In-Reply-To: <201006031527.25644.laurent.pinchart@ideasonboard.com> References: <201006031527.25644.laurent.pinchart@ideasonboard.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 03 Jun 2010 13:33:00 +0000 (UTC) diff --git a/drivers/media/video/isp/ispvideo.c b/drivers/media/video/isp/ispvideo.c index 7ecd35a..36625d1 100644 --- a/drivers/media/video/isp/ispvideo.c +++ b/drivers/media/video/isp/ispvideo.c @@ -59,7 +59,7 @@ isp_video_far_end(struct isp_video *video) struct media_entity_graph graph; struct media_entity *entity = &video->video.entity; struct media_device *mdev = entity->parent; - struct video_device *vdev = NULL; + struct isp_video *far_end = NULL; mutex_lock(&mdev->graph_mutex); media_entity_graph_walk_start(&graph, entity); @@ -68,14 +68,18 @@ isp_video_far_end(struct isp_video *video) if (entity == &video->video.entity) continue; - if (entity->type == MEDIA_ENTITY_TYPE_NODE) { - vdev = media_entity_to_video_device(entity); + if (entity->type != MEDIA_ENTITY_TYPE_NODE) + continue; + + far_end = to_isp_video(media_entity_to_video_device(entity)); + if (far_end->type != video->type) break; - } + + far_end = NULL; } mutex_unlock(&mdev->graph_mutex); - return vdev ? to_isp_video(vdev) : NULL; + return far_end; } /*