From ab22e77cd3d3073c8cac51b59713ef635678dfbe Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 11 Dec 2015 07:44:40 -0200 Subject: [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 --- drivers/media/media-entity.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'drivers/media/media-entity.c') diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c index 07f2dc6c2df6..ef2102ac0c66 100644 --- a/drivers/media/media-entity.c +++ b/drivers/media/media-entity.c @@ -197,7 +197,7 @@ void media_gobj_remove(struct media_gobj *gobj) } /** - * media_entity_init - Initialize a media entity + * media_entity_pads_init - Initialize a media entity * * @num_pads: Total number of sink and source pads. * @pads: Array of 'num_pads' pads. @@ -216,18 +216,15 @@ void media_gobj_remove(struct media_gobj *gobj) * number of allocated elements. * * The pads array is managed by the entity driver and passed to - * media_entity_init() where its pointer will be stored in the entity structure. + * media_entity_pads_init() where its pointer will be stored in the entity structure. */ int -media_entity_init(struct media_entity *entity, u16 num_pads, +media_entity_pads_init(struct media_entity *entity, u16 num_pads, struct media_pad *pads) { struct media_device *mdev = entity->graph_obj.mdev; unsigned int i; - entity->group_id = 0; - entity->num_links = 0; - entity->num_backlinks = 0; entity->num_pads = num_pads; entity->pads = pads; @@ -247,7 +244,7 @@ media_entity_init(struct media_entity *entity, u16 num_pads, return 0; } -EXPORT_SYMBOL_GPL(media_entity_init); +EXPORT_SYMBOL_GPL(media_entity_pads_init); void media_entity_cleanup(struct media_entity *entity) -- cgit v1.2.3