diff mbox

[linux-dali,1/1] omap3isp: video: Fix isp_video_far_end to return the correct entity

Message ID 1275572123-23516-1-git-send-email-laurent.pinchart@ideasonboard.com (mailing list archive)
State New, archived
Headers show

Commit Message

Laurent Pinchart June 3, 2010, 1:35 p.m. UTC
None
diff mbox

Patch

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;
 }
 
 /*