[media] media framework: rename pads init function to media_entity_pads_init()
With the MC next gen rework, what's left for media_entity_init() is to just initialize the PADs. However, certain devices, like a FLASH led/light doesn't have any input or output PAD. So, there's no reason why calling media_entity_init() would be mandatory. Also, despite its name, what this function actually does is to initialize the PADs data. So, rename it to media_entity_pads_init() in order to reflect that. The media entity actual init happens during entity register, at media_device_register_entity(). We should move init of num_links and num_backlinks to it. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
@@ -2655,7 +2655,7 @@ static int ccdc_init_entities(struct isp_ccdc_device *ccdc)
|
||||
pads[CCDC_PAD_SOURCE_OF].flags = MEDIA_PAD_FL_SOURCE;
|
||||
|
||||
me->ops = &ccdc_media_ops;
|
||||
ret = media_entity_init(me, CCDC_PADS_NUM, pads);
|
||||
ret = media_entity_pads_init(me, CCDC_PADS_NUM, pads);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@@ -1076,7 +1076,7 @@ static int ccp2_init_entities(struct isp_ccp2_device *ccp2)
|
||||
pads[CCP2_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
|
||||
|
||||
me->ops = &ccp2_media_ops;
|
||||
ret = media_entity_init(me, CCP2_PADS_NUM, pads);
|
||||
ret = media_entity_pads_init(me, CCP2_PADS_NUM, pads);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@@ -1250,7 +1250,7 @@ static int csi2_init_entities(struct isp_csi2_device *csi2)
|
||||
| MEDIA_PAD_FL_MUST_CONNECT;
|
||||
|
||||
me->ops = &csi2_media_ops;
|
||||
ret = media_entity_init(me, CSI2_PADS_NUM, pads);
|
||||
ret = media_entity_pads_init(me, CSI2_PADS_NUM, pads);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@@ -2287,7 +2287,7 @@ static int preview_init_entities(struct isp_prev_device *prev)
|
||||
pads[PREV_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
|
||||
|
||||
me->ops = &preview_media_ops;
|
||||
ret = media_entity_init(me, PREV_PADS_NUM, pads);
|
||||
ret = media_entity_pads_init(me, PREV_PADS_NUM, pads);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@@ -1733,7 +1733,7 @@ static int resizer_init_entities(struct isp_res_device *res)
|
||||
pads[RESZ_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
|
||||
|
||||
me->ops = &resizer_media_ops;
|
||||
ret = media_entity_init(me, RESZ_PADS_NUM, pads);
|
||||
ret = media_entity_pads_init(me, RESZ_PADS_NUM, pads);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@@ -1028,7 +1028,7 @@ static int isp_stat_init_entities(struct ispstat *stat, const char *name,
|
||||
stat->pad.flags = MEDIA_PAD_FL_SINK | MEDIA_PAD_FL_MUST_CONNECT;
|
||||
me->ops = NULL;
|
||||
|
||||
return media_entity_init(me, 1, &stat->pad);
|
||||
return media_entity_pads_init(me, 1, &stat->pad);
|
||||
}
|
||||
|
||||
int omap3isp_stat_init(struct ispstat *stat, const char *name,
|
||||
|
@@ -1368,7 +1368,7 @@ int omap3isp_video_init(struct isp_video *video, const char *name)
|
||||
if (IS_ERR(video->alloc_ctx))
|
||||
return PTR_ERR(video->alloc_ctx);
|
||||
|
||||
ret = media_entity_init(&video->video.entity, 1, &video->pad);
|
||||
ret = media_entity_pads_init(&video->video.entity, 1, &video->pad);
|
||||
if (ret < 0) {
|
||||
vb2_dma_contig_cleanup_ctx(video->alloc_ctx);
|
||||
return ret;
|
||||
|
Reference in New Issue
Block a user