Commit 45b46879 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

[media] media: Rename is_media_entity_v4l2_io to is_media_entity_v4l2_video_device

All users of is_media_entity_v4l2_io() (the exynos4-is, omap3isp,
davince_vpfe and omap4iss drivers and the v4l2-mc power management code)
use the function to check whether entities are video_device instances,
either to ensure they can cast the entity to a struct video_device, or
to count the number of video nodes users.

The purpose of the function is thus to identify whether the media entity
instance is an instance of the video_device object, not to check whether
it can perform I/O. Rename it accordingly, we will introduce a more
specific is_media_entity_v4l2_io() check when needed.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent b76a2a8c
...@@ -1132,7 +1132,7 @@ static int __fimc_md_modify_pipelines(struct media_entity *entity, bool enable, ...@@ -1132,7 +1132,7 @@ static int __fimc_md_modify_pipelines(struct media_entity *entity, bool enable,
media_entity_graph_walk_start(graph, entity); media_entity_graph_walk_start(graph, entity);
while ((entity = media_entity_graph_walk_next(graph))) { while ((entity = media_entity_graph_walk_next(graph))) {
if (!is_media_entity_v4l2_io(entity)) if (!is_media_entity_v4l2_video_device(entity))
continue; continue;
ret = __fimc_md_modify_pipeline(entity, enable); ret = __fimc_md_modify_pipeline(entity, enable);
...@@ -1147,7 +1147,7 @@ static int __fimc_md_modify_pipelines(struct media_entity *entity, bool enable, ...@@ -1147,7 +1147,7 @@ static int __fimc_md_modify_pipelines(struct media_entity *entity, bool enable,
media_entity_graph_walk_start(graph, entity_err); media_entity_graph_walk_start(graph, entity_err);
while ((entity_err = media_entity_graph_walk_next(graph))) { while ((entity_err = media_entity_graph_walk_next(graph))) {
if (!is_media_entity_v4l2_io(entity_err)) if (!is_media_entity_v4l2_video_device(entity_err))
continue; continue;
__fimc_md_modify_pipeline(entity_err, !enable); __fimc_md_modify_pipeline(entity_err, !enable);
......
...@@ -251,7 +251,7 @@ static int isp_video_get_graph_data(struct isp_video *video, ...@@ -251,7 +251,7 @@ static int isp_video_get_graph_data(struct isp_video *video,
if (entity == &video->video.entity) if (entity == &video->video.entity)
continue; continue;
if (!is_media_entity_v4l2_io(entity)) if (!is_media_entity_v4l2_video_device(entity))
continue; continue;
__video = to_isp_video(media_entity_to_video_device(entity)); __video = to_isp_video(media_entity_to_video_device(entity));
......
...@@ -263,7 +263,7 @@ static int pipeline_pm_use_count(struct media_entity *entity, ...@@ -263,7 +263,7 @@ static int pipeline_pm_use_count(struct media_entity *entity,
media_entity_graph_walk_start(graph, entity); media_entity_graph_walk_start(graph, entity);
while ((entity = media_entity_graph_walk_next(graph))) { while ((entity = media_entity_graph_walk_next(graph))) {
if (is_media_entity_v4l2_io(entity)) if (is_media_entity_v4l2_video_device(entity))
use += entity->use_count; use += entity->use_count;
} }
......
...@@ -154,7 +154,7 @@ static int vpfe_prepare_pipeline(struct vpfe_video_device *video) ...@@ -154,7 +154,7 @@ static int vpfe_prepare_pipeline(struct vpfe_video_device *video)
while ((entity = media_entity_graph_walk_next(&graph))) { while ((entity = media_entity_graph_walk_next(&graph))) {
if (entity == &video->video_dev.entity) if (entity == &video->video_dev.entity)
continue; continue;
if (!is_media_entity_v4l2_io(entity)) if (!is_media_entity_v4l2_video_device(entity))
continue; continue;
far_end = to_vpfe_video(media_entity_to_video_device(entity)); far_end = to_vpfe_video(media_entity_to_video_device(entity));
if (far_end->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) if (far_end->type == V4L2_BUF_TYPE_VIDEO_OUTPUT)
......
...@@ -223,7 +223,7 @@ iss_video_far_end(struct iss_video *video) ...@@ -223,7 +223,7 @@ iss_video_far_end(struct iss_video *video)
if (entity == &video->video.entity) if (entity == &video->video.entity)
continue; continue;
if (!is_media_entity_v4l2_io(entity)) if (!is_media_entity_v4l2_video_device(entity))
continue; continue;
far_end = to_iss_video(media_entity_to_video_device(entity)); far_end = to_iss_video(media_entity_to_video_device(entity));
......
...@@ -358,14 +358,14 @@ static inline u32 media_gobj_gen_id(enum media_gobj_type type, u64 local_id) ...@@ -358,14 +358,14 @@ static inline u32 media_gobj_gen_id(enum media_gobj_type type, u64 local_id)
} }
/** /**
* is_media_entity_v4l2_io() - Check if the entity is a video_device * is_media_entity_v4l2_video_device() - Check if the entity is a video_device
* @entity: pointer to entity * @entity: pointer to entity
* *
* Return: true if the entity is an instance of a video_device object and can * Return: true if the entity is an instance of a video_device object and can
* safely be cast to a struct video_device using the container_of() macro, or * safely be cast to a struct video_device using the container_of() macro, or
* false otherwise. * false otherwise.
*/ */
static inline bool is_media_entity_v4l2_io(struct media_entity *entity) static inline bool is_media_entity_v4l2_video_device(struct media_entity *entity)
{ {
return entity && entity->obj_type == MEDIA_ENTITY_TYPE_VIDEO_DEVICE; return entity && entity->obj_type == MEDIA_ENTITY_TYPE_VIDEO_DEVICE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment