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