aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/media-entity.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-08-06 09:25:57 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-01-11 12:18:39 -0200
commit1809510715c4187fa7338204cac53e30326d5d04 (patch)
treeca679c3f9e7e3a5d6bc05fe8ee05ae9f444cb6b0 /drivers/media/media-entity.c
parent[media] au0828: Cache the decoder info at au0828 dev structure (diff)
downloadlinux-dev-1809510715c4187fa7338204cac53e30326d5d04.tar.xz
linux-dev-1809510715c4187fa7338204cac53e30326d5d04.zip
[media] media: get rid of unused "extra_links" param on media_entity_init()
Currently, media_entity_init() creates an array with the links, allocated at init time. It provides a parameter (extra_links) that would allocate more links than the current needs, but this is not used by any driver. As we want to be able to do dynamic link allocation/removal, we'll need to change the implementation of the links. So, before doing that, let's first remove that extra unused parameter, in order to cleanup the interface first. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/media-entity.c')
-rw-r--r--drivers/media/media-entity.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
index 767fe55ba08e..eabcbacfe387 100644
--- a/drivers/media/media-entity.c
+++ b/drivers/media/media-entity.c
@@ -30,32 +30,30 @@
* media_entity_init - Initialize a media entity
*
* @num_pads: Total number of sink and source pads.
- * @extra_links: Initial estimate of the number of extra links.
* @pads: Array of 'num_pads' pads.
*
* The total number of pads is an intrinsic property of entities known by the
* entity driver, while the total number of links depends on hardware design
* and is an extrinsic property unknown to the entity driver. However, in most
- * use cases the entity driver can guess the number of links which can safely
- * be assumed to be equal to or larger than the number of pads.
+ * use cases the number of links can safely be assumed to be equal to or
+ * larger than the number of pads.
*
- * For those reasons the links array can be preallocated based on the entity
- * driver guess and will be reallocated later if extra links need to be
- * created.
+ * For those reasons the links array can be preallocated based on the number
+ * of pads and will be reallocated later if extra links need to be created.
*
* This function allocates a links array with enough space to hold at least
- * 'num_pads' + 'extra_links' elements. The media_entity::max_links field will
- * be set to the number of allocated elements.
+ * 'num_pads' elements. The media_entity::max_links field will be set to the
+ * 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.
*/
int
media_entity_init(struct media_entity *entity, u16 num_pads,
- struct media_pad *pads, u16 extra_links)
+ struct media_pad *pads)
{
struct media_link *links;
- unsigned int max_links = num_pads + extra_links;
+ unsigned int max_links = num_pads;
unsigned int i;
links = kzalloc(max_links * sizeof(links[0]), GFP_KERNEL);