diff options
author | Sakari Ailus <sakari.ailus@iki.fi> | 2015-12-16 11:32:36 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-01-11 12:19:22 -0200 |
commit | 030e89ecab55b6e105e19fa830a7a7160237f19a (patch) | |
tree | 8b2115efa6e3c9d868ed889b55cf0a2e5e092d19 /drivers/media/media-entity.c | |
parent | bb0faebdc1d377705081fed67af3f3f3001ac7b8 (diff) | |
download | linux-030e89ecab55b6e105e19fa830a7a7160237f19a.tar.gz linux-030e89ecab55b6e105e19fa830a7a7160237f19a.tar.bz2 linux-030e89ecab55b6e105e19fa830a7a7160237f19a.zip |
[media] media: Remove pre-allocated entity enumeration bitmap
The bitmaps for entity enumerations used to be statically allocated. Now
that the drivers have been converted to use the new interface which
explicitly initialises the enum objects, drop the pre-allocated bitmaps.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.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.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c index 3cad525c2ac1..5bd6f88501e2 100644 --- a/drivers/media/media-entity.c +++ b/drivers/media/media-entity.c @@ -81,14 +81,10 @@ static inline const char *intf_type(struct media_interface *intf) __must_check int __media_entity_enum_init(struct media_entity_enum *ent_enum, int idx_max) { - if (idx_max > MEDIA_ENTITY_ENUM_MAX_ID) { - ent_enum->bmap = kcalloc(DIV_ROUND_UP(idx_max, BITS_PER_LONG), - sizeof(long), GFP_KERNEL); - if (!ent_enum->bmap) - return -ENOMEM; - } else { - ent_enum->bmap = ent_enum->prealloc_bmap; - } + ent_enum->bmap = kcalloc(DIV_ROUND_UP(idx_max, BITS_PER_LONG), + sizeof(long), GFP_KERNEL); + if (!ent_enum->bmap) + return -ENOMEM; bitmap_zero(ent_enum->bmap, idx_max); ent_enum->idx_max = idx_max; @@ -104,9 +100,7 @@ EXPORT_SYMBOL_GPL(__media_entity_enum_init); */ void media_entity_enum_cleanup(struct media_entity_enum *ent_enum) { - if (ent_enum->bmap != ent_enum->prealloc_bmap) - kfree(ent_enum->bmap); - ent_enum->bmap = NULL; + kfree(ent_enum->bmap); } EXPORT_SYMBOL_GPL(media_entity_enum_cleanup); |