[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: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
index 537160b..f09f3a6 100644
--- a/drivers/media/media-device.c
+++ b/drivers/media/media-device.c
@@ -591,7 +591,7 @@
list_for_each_entry_safe(intf, tmp_intf, &mdev->interfaces,
graph_obj.list) {
__media_remove_intf_links(intf);
- media_gobj_remove(&intf->graph_obj);
+ media_gobj_destroy(&intf->graph_obj);
kfree(intf);
}
spin_unlock(&mdev->lock);
@@ -628,11 +628,11 @@
spin_lock(&mdev->lock);
/* 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 */
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);
spin_unlock(&mdev->lock);
@@ -673,10 +673,10 @@
/* Remove all pads that belong to this entity */
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 */
- media_gobj_remove(&entity->graph_obj);
+ media_gobj_destroy(&entity->graph_obj);
spin_unlock(&mdev->lock);
entity->graph_obj.mdev = NULL;
diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
index 57de112..861c8e7 100644
--- a/drivers/media/media-entity.c
+++ b/drivers/media/media-entity.c
@@ -134,7 +134,7 @@
}
/**
- * media_gobj_init - Initialize a graph object
+ * media_gobj_create - Initialize a graph object
*
* @mdev: Pointer to the media_device that contains the object
* @type: Type of the object
@@ -146,7 +146,7 @@
* is embedded on some other object, this function should be called before
* 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,
struct media_gobj *gobj)
{
@@ -180,13 +180,13 @@
}
/**
- * 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
*
* 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);
@@ -235,7 +235,7 @@
pads[i].entity = entity;
pads[i].index = i;
if (mdev)
- media_gobj_init(mdev, MEDIA_GRAPH_PAD,
+ media_gobj_create(mdev, MEDIA_GRAPH_PAD,
&entity->pads[i].graph_obj);
}
@@ -607,14 +607,14 @@
/* Remove the remote link */
list_del(&rlink->list);
- media_gobj_remove(&rlink->graph_obj);
+ media_gobj_destroy(&rlink->graph_obj);
kfree(rlink);
if (--remote->num_links == 0)
break;
}
list_del(&link->list);
- media_gobj_remove(&link->graph_obj);
+ media_gobj_destroy(&link->graph_obj);
kfree(link);
}
@@ -638,7 +638,7 @@
link->flags = flags;
/* 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);
/* Create the backlink. Backlinks are used to help graph traversal and
@@ -656,7 +656,7 @@
backlink->is_backlink = true;
/* 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);
link->reverse = backlink;
@@ -852,7 +852,7 @@
intf->flags = flags;
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 */
@@ -880,7 +880,7 @@
void media_devnode_remove(struct media_intf_devnode *devnode)
{
media_remove_intf_links(&devnode->intf);
- media_gobj_remove(&devnode->intf.graph_obj);
+ media_gobj_destroy(&devnode->intf.graph_obj);
kfree(devnode);
}
EXPORT_SYMBOL_GPL(media_devnode_remove);
@@ -900,7 +900,7 @@
link->flags = flags;
/* 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);
return link;
@@ -910,7 +910,7 @@
void __media_remove_intf_link(struct media_link *link)
{
list_del(&link->list);
- media_gobj_remove(&link->graph_obj);
+ media_gobj_destroy(&link->graph_obj);
kfree(link);
}
EXPORT_SYMBOL_GPL(__media_remove_intf_link);