Commit 3efdf62c authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] media: use macros to check for V4L2 subdev entities

Instead of relying on media subtype, use the new macros to detect
if an entity is a subdev or an A/V DMA entity.

Please note that most drivers assume that there's just AV_DMA or
V4L2 subdevs. This is not true anymore, as we've added MC support
for DVB, and there are plans to add support for ALSA and FB/DRM
too.

Ok, on the current pipelines supported by those drivers, just V4L
stuff are there, but, assuming that some day a pipeline that also
works with other subsystems will ever added, it is better to add
explicit checks for the AV_DMA stuff.
Acked-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent fa17b46a
...@@ -22,8 +22,7 @@ struct v4l2_subdev *fimc_find_remote_sensor(struct media_entity *entity) ...@@ -22,8 +22,7 @@ struct v4l2_subdev *fimc_find_remote_sensor(struct media_entity *entity)
while (pad->flags & MEDIA_PAD_FL_SINK) { while (pad->flags & MEDIA_PAD_FL_SINK) {
/* source pad */ /* source pad */
pad = media_entity_remote_pad(pad); pad = media_entity_remote_pad(pad);
if (pad == NULL || if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
break; break;
sd = media_entity_to_v4l2_subdev(pad->entity); sd = media_entity_to_v4l2_subdev(pad->entity);
......
...@@ -1136,8 +1136,7 @@ static int fimc_pipeline_validate(struct fimc_dev *fimc) ...@@ -1136,8 +1136,7 @@ static int fimc_pipeline_validate(struct fimc_dev *fimc)
} }
} }
if (src_pad == NULL || if (!src_pad || !is_media_entity_v4l2_subdev(src_pad->entity))
media_entity_type(src_pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
break; break;
/* Don't call FIMC subdev operation to avoid nested locking */ /* Don't call FIMC subdev operation to avoid nested locking */
...@@ -1392,7 +1391,7 @@ static int fimc_link_setup(struct media_entity *entity, ...@@ -1392,7 +1391,7 @@ static int fimc_link_setup(struct media_entity *entity,
struct fimc_vid_cap *vc = &fimc->vid_cap; struct fimc_vid_cap *vc = &fimc->vid_cap;
struct v4l2_subdev *sensor; struct v4l2_subdev *sensor;
if (media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV) if (!is_media_entity_v4l2_subdev(remote->entity))
return -EINVAL; return -EINVAL;
if (WARN_ON(fimc == NULL)) if (WARN_ON(fimc == NULL))
......
...@@ -466,8 +466,7 @@ static int isp_video_pipeline_validate(struct fimc_isp *isp) ...@@ -466,8 +466,7 @@ static int isp_video_pipeline_validate(struct fimc_isp *isp)
/* Retrieve format at the source pad */ /* Retrieve format at the source pad */
pad = media_entity_remote_pad(pad); pad = media_entity_remote_pad(pad);
if (pad == NULL || if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
break; break;
sd = media_entity_to_v4l2_subdev(pad->entity); sd = media_entity_to_v4l2_subdev(pad->entity);
......
...@@ -808,8 +808,7 @@ static int fimc_pipeline_validate(struct fimc_lite *fimc) ...@@ -808,8 +808,7 @@ static int fimc_pipeline_validate(struct fimc_lite *fimc)
} }
/* Retrieve format at the source pad */ /* Retrieve format at the source pad */
pad = media_entity_remote_pad(pad); pad = media_entity_remote_pad(pad);
if (pad == NULL || if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
break; break;
sd = media_entity_to_v4l2_subdev(pad->entity); sd = media_entity_to_v4l2_subdev(pad->entity);
...@@ -982,7 +981,6 @@ static int fimc_lite_link_setup(struct media_entity *entity, ...@@ -982,7 +981,6 @@ static int fimc_lite_link_setup(struct media_entity *entity,
{ {
struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity); struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity);
struct fimc_lite *fimc = v4l2_get_subdevdata(sd); struct fimc_lite *fimc = v4l2_get_subdevdata(sd);
unsigned int remote_ent_type = media_entity_type(remote->entity);
int ret = 0; int ret = 0;
if (WARN_ON(fimc == NULL)) if (WARN_ON(fimc == NULL))
...@@ -994,7 +992,7 @@ static int fimc_lite_link_setup(struct media_entity *entity, ...@@ -994,7 +992,7 @@ static int fimc_lite_link_setup(struct media_entity *entity,
switch (local->index) { switch (local->index) {
case FLITE_SD_PAD_SINK: case FLITE_SD_PAD_SINK:
if (remote_ent_type != MEDIA_ENT_T_V4L2_SUBDEV) { if (!is_media_entity_v4l2_subdev(remote->entity)) {
ret = -EINVAL; ret = -EINVAL;
break; break;
} }
...@@ -1012,7 +1010,7 @@ static int fimc_lite_link_setup(struct media_entity *entity, ...@@ -1012,7 +1010,7 @@ static int fimc_lite_link_setup(struct media_entity *entity,
case FLITE_SD_PAD_SOURCE_DMA: case FLITE_SD_PAD_SOURCE_DMA:
if (!(flags & MEDIA_LNK_FL_ENABLED)) if (!(flags & MEDIA_LNK_FL_ENABLED))
atomic_set(&fimc->out_path, FIMC_IO_NONE); atomic_set(&fimc->out_path, FIMC_IO_NONE);
else if (remote_ent_type == MEDIA_ENT_T_DEVNODE) else if (is_media_entity_v4l2_io(remote->entity))
atomic_set(&fimc->out_path, FIMC_IO_DMA); atomic_set(&fimc->out_path, FIMC_IO_DMA);
else else
ret = -EINVAL; ret = -EINVAL;
...@@ -1021,7 +1019,7 @@ static int fimc_lite_link_setup(struct media_entity *entity, ...@@ -1021,7 +1019,7 @@ static int fimc_lite_link_setup(struct media_entity *entity,
case FLITE_SD_PAD_SOURCE_ISP: case FLITE_SD_PAD_SOURCE_ISP:
if (!(flags & MEDIA_LNK_FL_ENABLED)) if (!(flags & MEDIA_LNK_FL_ENABLED))
atomic_set(&fimc->out_path, FIMC_IO_NONE); atomic_set(&fimc->out_path, FIMC_IO_NONE);
else if (remote_ent_type == MEDIA_ENT_T_V4L2_SUBDEV) else if (is_media_entity_v4l2_subdev(remote->entity))
atomic_set(&fimc->out_path, FIMC_IO_ISP); atomic_set(&fimc->out_path, FIMC_IO_ISP);
else else
ret = -EINVAL; ret = -EINVAL;
......
...@@ -88,8 +88,7 @@ static void fimc_pipeline_prepare(struct fimc_pipeline *p, ...@@ -88,8 +88,7 @@ static void fimc_pipeline_prepare(struct fimc_pipeline *p,
break; break;
} }
if (pad == NULL || if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
break; break;
sd = media_entity_to_v4l2_subdev(pad->entity); sd = media_entity_to_v4l2_subdev(pad->entity);
...@@ -1062,7 +1061,7 @@ static int __fimc_md_modify_pipelines(struct media_entity *entity, bool enable) ...@@ -1062,7 +1061,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 (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE) if (!is_media_entity_v4l2_io(entity))
continue; continue;
ret = __fimc_md_modify_pipeline(entity, enable); ret = __fimc_md_modify_pipeline(entity, enable);
...@@ -1076,7 +1075,7 @@ static int __fimc_md_modify_pipelines(struct media_entity *entity, bool enable) ...@@ -1076,7 +1075,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 (media_entity_type(entity_err) != MEDIA_ENT_T_DEVNODE) if (!is_media_entity_v4l2_io(entity_err))
continue; continue;
__fimc_md_modify_pipeline(entity_err, !enable); __fimc_md_modify_pipeline(entity_err, !enable);
......
...@@ -691,7 +691,7 @@ static int isp_pipeline_pm_use_count(struct media_entity *entity) ...@@ -691,7 +691,7 @@ static int isp_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 (media_entity_type(entity) == MEDIA_ENT_T_DEVNODE) if (is_media_entity_v4l2_io(entity))
use += entity->use_count; use += entity->use_count;
} }
...@@ -714,7 +714,7 @@ static int isp_pipeline_pm_power_one(struct media_entity *entity, int change) ...@@ -714,7 +714,7 @@ static int isp_pipeline_pm_power_one(struct media_entity *entity, int change)
struct v4l2_subdev *subdev; struct v4l2_subdev *subdev;
int ret; int ret;
subdev = media_entity_type(entity) == MEDIA_ENT_T_V4L2_SUBDEV subdev = is_media_entity_v4l2_subdev(entity)
? media_entity_to_v4l2_subdev(entity) : NULL; ? media_entity_to_v4l2_subdev(entity) : NULL;
if (entity->use_count == 0 && change > 0 && subdev != NULL) { if (entity->use_count == 0 && change > 0 && subdev != NULL) {
...@@ -754,7 +754,7 @@ static int isp_pipeline_pm_power(struct media_entity *entity, int change) ...@@ -754,7 +754,7 @@ static int isp_pipeline_pm_power(struct media_entity *entity, int change)
media_entity_graph_walk_start(&graph, entity); media_entity_graph_walk_start(&graph, entity);
while (!ret && (entity = media_entity_graph_walk_next(&graph))) while (!ret && (entity = media_entity_graph_walk_next(&graph)))
if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE) if (is_media_entity_v4l2_subdev(entity))
ret = isp_pipeline_pm_power_one(entity, change); ret = isp_pipeline_pm_power_one(entity, change);
if (!ret) if (!ret)
...@@ -764,7 +764,7 @@ static int isp_pipeline_pm_power(struct media_entity *entity, int change) ...@@ -764,7 +764,7 @@ static int isp_pipeline_pm_power(struct media_entity *entity, int change)
while ((first = media_entity_graph_walk_next(&graph)) while ((first = media_entity_graph_walk_next(&graph))
&& first != entity) && first != entity)
if (media_entity_type(first) != MEDIA_ENT_T_DEVNODE) if (is_media_entity_v4l2_subdev(first))
isp_pipeline_pm_power_one(first, -change); isp_pipeline_pm_power_one(first, -change);
return ret; return ret;
...@@ -897,8 +897,7 @@ static int isp_pipeline_enable(struct isp_pipeline *pipe, ...@@ -897,8 +897,7 @@ static int isp_pipeline_enable(struct isp_pipeline *pipe,
break; break;
pad = media_entity_remote_pad(pad); pad = media_entity_remote_pad(pad);
if (pad == NULL || if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
break; break;
entity = pad->entity; entity = pad->entity;
...@@ -988,8 +987,7 @@ static int isp_pipeline_disable(struct isp_pipeline *pipe) ...@@ -988,8 +987,7 @@ static int isp_pipeline_disable(struct isp_pipeline *pipe)
break; break;
pad = media_entity_remote_pad(pad); pad = media_entity_remote_pad(pad);
if (pad == NULL || if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
break; break;
entity = pad->entity; entity = pad->entity;
......
...@@ -210,8 +210,7 @@ isp_video_remote_subdev(struct isp_video *video, u32 *pad) ...@@ -210,8 +210,7 @@ isp_video_remote_subdev(struct isp_video *video, u32 *pad)
remote = media_entity_remote_pad(&video->pad); remote = media_entity_remote_pad(&video->pad);
if (remote == NULL || if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
return NULL; return NULL;
if (pad) if (pad)
...@@ -243,7 +242,7 @@ static int isp_video_get_graph_data(struct isp_video *video, ...@@ -243,7 +242,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 (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE) if (!is_media_entity_v4l2_io(entity))
continue; continue;
__video = to_isp_video(media_entity_to_video_device(entity)); __video = to_isp_video(media_entity_to_video_device(entity));
...@@ -919,7 +918,7 @@ static int isp_video_check_external_subdevs(struct isp_video *video, ...@@ -919,7 +918,7 @@ static int isp_video_check_external_subdevs(struct isp_video *video,
return -EINVAL; return -EINVAL;
} }
if (media_entity_type(source) != MEDIA_ENT_T_V4L2_SUBDEV) if (!is_media_entity_v4l2_subdev(source))
return 0; return 0;
pipe->external = media_entity_to_v4l2_subdev(source); pipe->external = media_entity_to_v4l2_subdev(source);
......
...@@ -822,7 +822,7 @@ static int camif_pipeline_validate(struct camif_dev *camif) ...@@ -822,7 +822,7 @@ static int camif_pipeline_validate(struct camif_dev *camif)
/* Retrieve format at the sensor subdev source pad */ /* Retrieve format at the sensor subdev source pad */
pad = media_entity_remote_pad(&camif->pads[0]); pad = media_entity_remote_pad(&camif->pads[0]);
if (!pad || media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
return -EPIPE; return -EPIPE;
src_fmt.pad = pad->index; src_fmt.pad = pad->index;
......
...@@ -160,8 +160,7 @@ vsp1_video_remote_subdev(struct media_pad *local, u32 *pad) ...@@ -160,8 +160,7 @@ vsp1_video_remote_subdev(struct media_pad *local, u32 *pad)
struct media_pad *remote; struct media_pad *remote;
remote = media_entity_remote_pad(local); remote = media_entity_remote_pad(local);
if (remote == NULL || if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
return NULL; return NULL;
if (pad) if (pad)
...@@ -297,7 +296,7 @@ static int vsp1_pipeline_validate_branch(struct vsp1_pipeline *pipe, ...@@ -297,7 +296,7 @@ static int vsp1_pipeline_validate_branch(struct vsp1_pipeline *pipe,
return -EPIPE; return -EPIPE;
/* We've reached a video node, that shouldn't have happened. */ /* We've reached a video node, that shouldn't have happened. */
if (media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) if (!is_media_entity_v4l2_subdev(pad->entity))
return -EPIPE; return -EPIPE;
entity = to_vsp1_entity(media_entity_to_v4l2_subdev(pad->entity)); entity = to_vsp1_entity(media_entity_to_v4l2_subdev(pad->entity));
...@@ -394,7 +393,7 @@ static int vsp1_pipeline_validate(struct vsp1_pipeline *pipe, ...@@ -394,7 +393,7 @@ static int vsp1_pipeline_validate(struct vsp1_pipeline *pipe,
struct vsp1_rwpf *rwpf; struct vsp1_rwpf *rwpf;
struct vsp1_entity *e; struct vsp1_entity *e;
if (media_entity_type(entity) != MEDIA_ENT_T_V4L2_SUBDEV) { if (is_media_entity_v4l2_io(entity)) {
pipe->num_video++; pipe->num_video++;
continue; continue;
} }
...@@ -663,7 +662,7 @@ void vsp1_pipeline_propagate_alpha(struct vsp1_pipeline *pipe, ...@@ -663,7 +662,7 @@ void vsp1_pipeline_propagate_alpha(struct vsp1_pipeline *pipe,
pad = media_entity_remote_pad(&input->pads[RWPF_PAD_SOURCE]); pad = media_entity_remote_pad(&input->pads[RWPF_PAD_SOURCE]);
while (pad) { while (pad) {
if (media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) if (!is_media_entity_v4l2_subdev(pad->entity))
break; break;
entity = to_vsp1_entity(media_entity_to_v4l2_subdev(pad->entity)); entity = to_vsp1_entity(media_entity_to_v4l2_subdev(pad->entity));
......
...@@ -49,8 +49,7 @@ xvip_dma_remote_subdev(struct media_pad *local, u32 *pad) ...@@ -49,8 +49,7 @@ xvip_dma_remote_subdev(struct media_pad *local, u32 *pad)
struct media_pad *remote; struct media_pad *remote;
remote = media_entity_remote_pad(local); remote = media_entity_remote_pad(local);
if (remote == NULL || if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
return NULL; return NULL;
if (pad) if (pad)
...@@ -113,8 +112,7 @@ static int xvip_pipeline_start_stop(struct xvip_pipeline *pipe, bool start) ...@@ -113,8 +112,7 @@ static int xvip_pipeline_start_stop(struct xvip_pipeline *pipe, bool start)
break; break;
pad = media_entity_remote_pad(pad); pad = media_entity_remote_pad(pad);
if (pad == NULL || if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
break; break;
entity = pad->entity; entity = pad->entity;
......
...@@ -526,7 +526,7 @@ static int ...@@ -526,7 +526,7 @@ static int
v4l2_subdev_link_validate_get_format(struct media_pad *pad, v4l2_subdev_link_validate_get_format(struct media_pad *pad,
struct v4l2_subdev_format *fmt) struct v4l2_subdev_format *fmt)
{ {
if (media_entity_type(pad->entity) == MEDIA_ENT_T_V4L2_SUBDEV) { if (is_media_entity_v4l2_subdev(pad->entity)) {
struct v4l2_subdev *sd = struct v4l2_subdev *sd =
media_entity_to_v4l2_subdev(pad->entity); media_entity_to_v4l2_subdev(pad->entity);
......
...@@ -148,7 +148,7 @@ static void vpfe_prepare_pipeline(struct vpfe_video_device *video) ...@@ -148,7 +148,7 @@ static void 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 (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE) if ((!is_media_entity_v4l2_io(remote->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)
...@@ -293,7 +293,7 @@ static int vpfe_pipeline_enable(struct vpfe_pipeline *pipe) ...@@ -293,7 +293,7 @@ static int vpfe_pipeline_enable(struct vpfe_pipeline *pipe)
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 (media_entity_type(entity) == MEDIA_ENT_T_DEVNODE) if !is_media_entity_v4l2_subdev(entity))
continue; continue;
subdev = media_entity_to_v4l2_subdev(entity); subdev = media_entity_to_v4l2_subdev(entity);
ret = v4l2_subdev_call(subdev, video, s_stream, 1); ret = v4l2_subdev_call(subdev, video, s_stream, 1);
...@@ -334,7 +334,7 @@ static int vpfe_pipeline_disable(struct vpfe_pipeline *pipe) ...@@ -334,7 +334,7 @@ static int vpfe_pipeline_disable(struct vpfe_pipeline *pipe)
while ((entity = media_entity_graph_walk_next(&graph))) { while ((entity = media_entity_graph_walk_next(&graph))) {
if (media_entity_type(entity) == MEDIA_ENT_T_DEVNODE) if (!is_media_entity_v4l2_subdev(entity))
continue; continue;
subdev = media_entity_to_v4l2_subdev(entity); subdev = media_entity_to_v4l2_subdev(entity);
ret = v4l2_subdev_call(subdev, video, s_stream, 0); ret = v4l2_subdev_call(subdev, video, s_stream, 0);
......
...@@ -397,7 +397,7 @@ static int iss_pipeline_pm_use_count(struct media_entity *entity) ...@@ -397,7 +397,7 @@ static int iss_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 (media_entity_type(entity) == MEDIA_ENT_T_DEVNODE) if (is_media_entity_v4l2_io(entity))
use += entity->use_count; use += entity->use_count;
} }
...@@ -419,7 +419,7 @@ static int iss_pipeline_pm_power_one(struct media_entity *entity, int change) ...@@ -419,7 +419,7 @@ static int iss_pipeline_pm_power_one(struct media_entity *entity, int change)
{ {
struct v4l2_subdev *subdev; struct v4l2_subdev *subdev;
subdev = media_entity_type(entity) == MEDIA_ENT_T_V4L2_SUBDEV subdev = is_media_entity_v4l2_subdev(entity)
? media_entity_to_v4l2_subdev(entity) : NULL; ? media_entity_to_v4l2_subdev(entity) : NULL;
if (entity->use_count == 0 && change > 0 && subdev) { if (entity->use_count == 0 && change > 0 && subdev) {
...@@ -461,7 +461,7 @@ static int iss_pipeline_pm_power(struct media_entity *entity, int change) ...@@ -461,7 +461,7 @@ static int iss_pipeline_pm_power(struct media_entity *entity, int change)
media_entity_graph_walk_start(&graph, entity); media_entity_graph_walk_start(&graph, entity);
while (!ret && (entity = media_entity_graph_walk_next(&graph))) while (!ret && (entity = media_entity_graph_walk_next(&graph)))
if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE) if (is_media_entity_v4l2_subdev(entity))
ret = iss_pipeline_pm_power_one(entity, change); ret = iss_pipeline_pm_power_one(entity, change);
if (!ret) if (!ret)
...@@ -471,7 +471,7 @@ static int iss_pipeline_pm_power(struct media_entity *entity, int change) ...@@ -471,7 +471,7 @@ static int iss_pipeline_pm_power(struct media_entity *entity, int change)
while ((first = media_entity_graph_walk_next(&graph)) && while ((first = media_entity_graph_walk_next(&graph)) &&
first != entity) first != entity)
if (media_entity_type(first) != MEDIA_ENT_T_DEVNODE) if (is_media_entity_v4l2_subdev(first))
iss_pipeline_pm_power_one(first, -change); iss_pipeline_pm_power_one(first, -change);
return ret; return ret;
...@@ -590,8 +590,7 @@ static int iss_pipeline_disable(struct iss_pipeline *pipe, ...@@ -590,8 +590,7 @@ static int iss_pipeline_disable(struct iss_pipeline *pipe,
break; break;
pad = media_entity_remote_pad(pad); pad = media_entity_remote_pad(pad);
if (!pad || if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
break; break;
entity = pad->entity; entity = pad->entity;
...@@ -658,8 +657,7 @@ static int iss_pipeline_enable(struct iss_pipeline *pipe, ...@@ -658,8 +657,7 @@ static int iss_pipeline_enable(struct iss_pipeline *pipe,
break; break;
pad = media_entity_remote_pad(pad); pad = media_entity_remote_pad(pad);
if (!pad || if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
break; break;
entity = pad->entity; entity = pad->entity;
......
...@@ -190,8 +190,7 @@ iss_video_remote_subdev(struct iss_video *video, u32 *pad) ...@@ -190,8 +190,7 @@ iss_video_remote_subdev(struct iss_video *video, u32 *pad)
remote = media_entity_remote_pad(&video->pad); remote = media_entity_remote_pad(&video->pad);
if (!remote || if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
return NULL; return NULL;
if (pad) if (pad)
...@@ -216,7 +215,7 @@ iss_video_far_end(struct iss_video *video) ...@@ -216,7 +215,7 @@ iss_video_far_end(struct iss_video *video)
if (entity == &video->video.entity) if (entity == &video->video.entity)
continue; continue;
if (media_entity_type(entity) != MEDIA_ENT_T_DEVNODE) if (!is_media_entity_v4l2_io(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));
......
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