summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2013-05-09 08:29:32 -0300
committerChanho Park <chanho61.park@samsung.com>2014-11-18 11:43:00 +0900
commite9a6c5f1e76152bf6c823349eaaca68f46d72fdd (patch)
tree3180a176516159c653ec24ef2647916e72bd863c /include
parent7647e2eb17ebabfc62e51d4e1b3ff822933ad958 (diff)
downloadlinux-3.10-e9a6c5f1e76152bf6c823349eaaca68f46d72fdd.tar.gz
linux-3.10-e9a6c5f1e76152bf6c823349eaaca68f46d72fdd.tar.bz2
linux-3.10-e9a6c5f1e76152bf6c823349eaaca68f46d72fdd.zip
[media] media: Add a function removing all links of a media entity
This function allows to remove all media entity's links to other entities, leaving no references to a media entity's links array at its remote entities. Currently, when a driver of some entity is removed it will free its media entities links[] array, leaving dangling pointers at other entities that are part of same media graph. This is troublesome when drivers of a media device entities are in separate kernel modules, removing only some modules will leave others in an incorrect state. This function is intended to be used when an entity is being unregistered from a media device. With an assumption that normally the media links should be created between media entities registered to a media device, with the graph mutex held. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Reviewed-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/media/media-entity.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/media/media-entity.h b/include/media/media-entity.h
index 4eefedcaa66..06bacf937d6 100644
--- a/include/media/media-entity.h
+++ b/include/media/media-entity.h
@@ -128,6 +128,9 @@ void media_entity_cleanup(struct media_entity *entity);
int media_entity_create_link(struct media_entity *source, u16 source_pad,
struct media_entity *sink, u16 sink_pad, u32 flags);
+void __media_entity_remove_links(struct media_entity *entity);
+void media_entity_remove_links(struct media_entity *entity);
+
int __media_entity_setup_link(struct media_link *link, u32 flags);
int media_entity_setup_link(struct media_link *link, u32 flags);
struct media_link *media_entity_find_link(struct media_pad *source,