Commit c350ef83 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] media_entity: rename media_obj functions to *_create *_destroy

Those media_obj_* functions are actually creating/destroying
media graph objects. So, rename them to better represent
what they're actually doing.

No functional changes.

This was created via this small shell script:

	for i in $(git grep -l media_gobj_init); do sed s,media_gobj_init,media_gobj_create,g <$i >a && mv a $i; done
	for i in $(git grep -l media_gobj_remove); do sed s,media_gobj_remove,media_gobj_destroy,g <$i >a && mv a $i; done
Suggested-by: default avatarSakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 58f69ee9
...@@ -591,7 +591,7 @@ void media_device_unregister(struct media_device *mdev) ...@@ -591,7 +591,7 @@ void media_device_unregister(struct media_device *mdev)
list_for_each_entry_safe(intf, tmp_intf, &mdev->interfaces, list_for_each_entry_safe(intf, tmp_intf, &mdev->interfaces,
graph_obj.list) { graph_obj.list) {
__media_remove_intf_links(intf); __media_remove_intf_links(intf);
media_gobj_remove(&intf->graph_obj); media_gobj_destroy(&intf->graph_obj);
kfree(intf); kfree(intf);
} }
spin_unlock(&mdev->lock); spin_unlock(&mdev->lock);
...@@ -628,11 +628,11 @@ int __must_check media_device_register_entity(struct media_device *mdev, ...@@ -628,11 +628,11 @@ int __must_check media_device_register_entity(struct media_device *mdev,
spin_lock(&mdev->lock); spin_lock(&mdev->lock);
/* Initialize media_gobj embedded at the entity */ /* Initialize media_gobj embedded at the entity */
media_gobj_init(mdev, MEDIA_GRAPH_ENTITY, &entity->graph_obj); media_gobj_create(mdev, MEDIA_GRAPH_ENTITY, &entity->graph_obj);
/* Initialize objects at the pads */ /* Initialize objects at the pads */
for (i = 0; i < entity->num_pads; i++) for (i = 0; i < entity->num_pads; i++)
media_gobj_init(mdev, MEDIA_GRAPH_PAD, media_gobj_create(mdev, MEDIA_GRAPH_PAD,
&entity->pads[i].graph_obj); &entity->pads[i].graph_obj);
spin_unlock(&mdev->lock); spin_unlock(&mdev->lock);
...@@ -673,10 +673,10 @@ void media_device_unregister_entity(struct media_entity *entity) ...@@ -673,10 +673,10 @@ void media_device_unregister_entity(struct media_entity *entity)
/* Remove all pads that belong to this entity */ /* Remove all pads that belong to this entity */
for (i = 0; i < entity->num_pads; i++) for (i = 0; i < entity->num_pads; i++)
media_gobj_remove(&entity->pads[i].graph_obj); media_gobj_destroy(&entity->pads[i].graph_obj);
/* Remove the entity */ /* Remove the entity */
media_gobj_remove(&entity->graph_obj); media_gobj_destroy(&entity->graph_obj);
spin_unlock(&mdev->lock); spin_unlock(&mdev->lock);
entity->graph_obj.mdev = NULL; entity->graph_obj.mdev = NULL;
......
...@@ -134,7 +134,7 @@ static void dev_dbg_obj(const char *event_name, struct media_gobj *gobj) ...@@ -134,7 +134,7 @@ static void dev_dbg_obj(const char *event_name, struct media_gobj *gobj)
} }
/** /**
* media_gobj_init - Initialize a graph object * media_gobj_create - Initialize a graph object
* *
* @mdev: Pointer to the media_device that contains the object * @mdev: Pointer to the media_device that contains the object
* @type: Type of the object * @type: Type of the object
...@@ -146,7 +146,7 @@ static void dev_dbg_obj(const char *event_name, struct media_gobj *gobj) ...@@ -146,7 +146,7 @@ static void dev_dbg_obj(const char *event_name, struct media_gobj *gobj)
* is embedded on some other object, this function should be called before * is embedded on some other object, this function should be called before
* registering the object at the media controller. * registering the object at the media controller.
*/ */
void media_gobj_init(struct media_device *mdev, void media_gobj_create(struct media_device *mdev,
enum media_gobj_type type, enum media_gobj_type type,
struct media_gobj *gobj) struct media_gobj *gobj)
{ {
...@@ -180,13 +180,13 @@ void media_gobj_init(struct media_device *mdev, ...@@ -180,13 +180,13 @@ void media_gobj_init(struct media_device *mdev,
} }
/** /**
* media_gobj_remove - Stop using a graph object on a media device * media_gobj_destroy - Stop using a graph object on a media device
* *
* @graph_obj: Pointer to the object * @graph_obj: Pointer to the object
* *
* This should be called at media_device_unregister_*() routines * This should be called at media_device_unregister_*() routines
*/ */
void media_gobj_remove(struct media_gobj *gobj) void media_gobj_destroy(struct media_gobj *gobj)
{ {
dev_dbg_obj(__func__, gobj); dev_dbg_obj(__func__, gobj);
...@@ -235,7 +235,7 @@ media_entity_pads_init(struct media_entity *entity, u16 num_pads, ...@@ -235,7 +235,7 @@ media_entity_pads_init(struct media_entity *entity, u16 num_pads,
pads[i].entity = entity; pads[i].entity = entity;
pads[i].index = i; pads[i].index = i;
if (mdev) if (mdev)
media_gobj_init(mdev, MEDIA_GRAPH_PAD, media_gobj_create(mdev, MEDIA_GRAPH_PAD,
&entity->pads[i].graph_obj); &entity->pads[i].graph_obj);
} }
...@@ -607,14 +607,14 @@ static void __media_entity_remove_link(struct media_entity *entity, ...@@ -607,14 +607,14 @@ static void __media_entity_remove_link(struct media_entity *entity,
/* Remove the remote link */ /* Remove the remote link */
list_del(&rlink->list); list_del(&rlink->list);
media_gobj_remove(&rlink->graph_obj); media_gobj_destroy(&rlink->graph_obj);
kfree(rlink); kfree(rlink);
if (--remote->num_links == 0) if (--remote->num_links == 0)
break; break;
} }
list_del(&link->list); list_del(&link->list);
media_gobj_remove(&link->graph_obj); media_gobj_destroy(&link->graph_obj);
kfree(link); kfree(link);
} }
...@@ -638,7 +638,7 @@ media_create_pad_link(struct media_entity *source, u16 source_pad, ...@@ -638,7 +638,7 @@ media_create_pad_link(struct media_entity *source, u16 source_pad,
link->flags = flags; link->flags = flags;
/* Initialize graph object embedded at the new link */ /* Initialize graph object embedded at the new link */
media_gobj_init(source->graph_obj.mdev, MEDIA_GRAPH_LINK, media_gobj_create(source->graph_obj.mdev, MEDIA_GRAPH_LINK,
&link->graph_obj); &link->graph_obj);
/* Create the backlink. Backlinks are used to help graph traversal and /* Create the backlink. Backlinks are used to help graph traversal and
...@@ -656,7 +656,7 @@ media_create_pad_link(struct media_entity *source, u16 source_pad, ...@@ -656,7 +656,7 @@ media_create_pad_link(struct media_entity *source, u16 source_pad,
backlink->is_backlink = true; backlink->is_backlink = true;
/* Initialize graph object embedded at the new link */ /* Initialize graph object embedded at the new link */
media_gobj_init(sink->graph_obj.mdev, MEDIA_GRAPH_LINK, media_gobj_create(sink->graph_obj.mdev, MEDIA_GRAPH_LINK,
&backlink->graph_obj); &backlink->graph_obj);
link->reverse = backlink; link->reverse = backlink;
...@@ -852,7 +852,7 @@ static void media_interface_init(struct media_device *mdev, ...@@ -852,7 +852,7 @@ static void media_interface_init(struct media_device *mdev,
intf->flags = flags; intf->flags = flags;
INIT_LIST_HEAD(&intf->links); INIT_LIST_HEAD(&intf->links);
media_gobj_init(mdev, gobj_type, &intf->graph_obj); media_gobj_create(mdev, gobj_type, &intf->graph_obj);
} }
/* Functions related to the media interface via device nodes */ /* Functions related to the media interface via device nodes */
...@@ -880,7 +880,7 @@ EXPORT_SYMBOL_GPL(media_devnode_create); ...@@ -880,7 +880,7 @@ EXPORT_SYMBOL_GPL(media_devnode_create);
void media_devnode_remove(struct media_intf_devnode *devnode) void media_devnode_remove(struct media_intf_devnode *devnode)
{ {
media_remove_intf_links(&devnode->intf); media_remove_intf_links(&devnode->intf);
media_gobj_remove(&devnode->intf.graph_obj); media_gobj_destroy(&devnode->intf.graph_obj);
kfree(devnode); kfree(devnode);
} }
EXPORT_SYMBOL_GPL(media_devnode_remove); EXPORT_SYMBOL_GPL(media_devnode_remove);
...@@ -900,7 +900,7 @@ struct media_link *media_create_intf_link(struct media_entity *entity, ...@@ -900,7 +900,7 @@ struct media_link *media_create_intf_link(struct media_entity *entity,
link->flags = flags; link->flags = flags;
/* Initialize graph object embedded at the new link */ /* Initialize graph object embedded at the new link */
media_gobj_init(intf->graph_obj.mdev, MEDIA_GRAPH_LINK, media_gobj_create(intf->graph_obj.mdev, MEDIA_GRAPH_LINK,
&link->graph_obj); &link->graph_obj);
return link; return link;
...@@ -910,7 +910,7 @@ EXPORT_SYMBOL_GPL(media_create_intf_link); ...@@ -910,7 +910,7 @@ EXPORT_SYMBOL_GPL(media_create_intf_link);
void __media_remove_intf_link(struct media_link *link) void __media_remove_intf_link(struct media_link *link)
{ {
list_del(&link->list); list_del(&link->list);
media_gobj_remove(&link->graph_obj); media_gobj_destroy(&link->graph_obj);
kfree(link); kfree(link);
} }
EXPORT_SYMBOL_GPL(__media_remove_intf_link); EXPORT_SYMBOL_GPL(__media_remove_intf_link);
......
...@@ -338,10 +338,10 @@ struct media_entity_graph { ...@@ -338,10 +338,10 @@ struct media_entity_graph {
#define intf_to_devnode(intf) \ #define intf_to_devnode(intf) \
container_of(intf, struct media_intf_devnode, intf) container_of(intf, struct media_intf_devnode, intf)
void media_gobj_init(struct media_device *mdev, void media_gobj_create(struct media_device *mdev,
enum media_gobj_type type, enum media_gobj_type type,
struct media_gobj *gobj); struct media_gobj *gobj);
void media_gobj_remove(struct media_gobj *gobj); void media_gobj_destroy(struct media_gobj *gobj);
/** /**
* media_entity_pads_init() - Initialize the entity pads * media_entity_pads_init() - Initialize the entity pads
......
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