summaryrefslogtreecommitdiffstats
path: root/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-05-07 22:12:36 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-01-11 12:18:51 -0200
commit14fae6fc53b2b390bbba650d60b9555e9f7f4f26 (patch)
treeca17293c2420d3520be203c97e84d7ef294fe769 /drivers/staging/media/davinci_vpfe/dm365_ipipe.c
parent26614b9bf8b534406835ea66732c12e6fd7b50fd (diff)
downloadop-kernel-dev-14fae6fc53b2b390bbba650d60b9555e9f7f4f26.zip
op-kernel-dev-14fae6fc53b2b390bbba650d60b9555e9f7f4f26.tar.gz
[media] davinci_vbpe: stop MEDIA_ENT_T_V4L2_SUBDEV abuse
This driver is abusing MEDIA_ENT_T_V4L2_SUBDEV: - it uses a hack to check if the remote entity is a subdev; - it still uses the legacy entity subtype check macro, that will be removed soon. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/staging/media/davinci_vpfe/dm365_ipipe.c')
-rw-r--r--drivers/staging/media/davinci_vpfe/dm365_ipipe.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
index 3badf16..77837af 100644
--- a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
+++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
@@ -1712,8 +1712,11 @@ ipipe_link_setup(struct media_entity *entity, const struct media_pad *local,
struct vpfe_device *vpfe_dev = to_vpfe_device(ipipe);
u16 ipipeif_sink = vpfe_dev->vpfe_ipipeif.input;
- switch (local->index | media_entity_type(remote->entity)) {
- case IPIPE_PAD_SINK | MEDIA_ENT_T_V4L2_SUBDEV:
+ if (!is_media_entity_v4l2_subdev(remote->entity))
+ return -EINVAL;
+
+ switch (local->index) {
+ case IPIPE_PAD_SINK:
if (!(flags & MEDIA_LNK_FL_ENABLED)) {
ipipe->input = IPIPE_INPUT_NONE;
break;
@@ -1726,7 +1729,7 @@ ipipe_link_setup(struct media_entity *entity, const struct media_pad *local,
ipipe->input = IPIPE_INPUT_CCDC;
break;
- case IPIPE_PAD_SOURCE | MEDIA_ENT_T_V4L2_SUBDEV:
+ case IPIPE_PAD_SOURCE:
/* out to RESIZER */
if (flags & MEDIA_LNK_FL_ENABLED)
ipipe->output = IPIPE_OUTPUT_RESIZER;
OpenPOWER on IntegriCloud