summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBartosz Golaszewski <bgolaszewski@baylibre.com>2021-03-15 12:13:56 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-08-21 16:15:45 +0300
commit26a10aef28d9e9bfaf975b390224009af6b10767 (patch)
tree3244d5eebf95b60a84266a5907c4b4635f417b1b /include
parent1238da5f32b72e9c9880e37a4fee38b4c4fc4f73 (diff)
downloadlinux-26a10aef28d9e9bfaf975b390224009af6b10767.tar.xz
lib: bitmap: provide devm_bitmap_alloc() and devm_bitmap_zalloc()
[ Upstream commit e829c2e4744850bab4d8f8ffebd00df10b4c6c2b ] Provide managed variants of bitmap_alloc() and bitmap_zalloc(). Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/bitmap.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
index 4dd2e1d39c74..c4f6a9270c03 100644
--- a/include/linux/bitmap.h
+++ b/include/linux/bitmap.h
@@ -9,6 +9,8 @@
#include <linux/string.h>
#include <linux/types.h>
+struct device;
+
/*
* bitmaps provide bit arrays that consume one or more unsigned
* longs. The bitmap interface and available operations are listed
@@ -122,6 +124,12 @@ extern unsigned long *bitmap_alloc(unsigned int nbits, gfp_t flags);
extern unsigned long *bitmap_zalloc(unsigned int nbits, gfp_t flags);
extern void bitmap_free(const unsigned long *bitmap);
+/* Managed variants of the above. */
+unsigned long *devm_bitmap_alloc(struct device *dev,
+ unsigned int nbits, gfp_t flags);
+unsigned long *devm_bitmap_zalloc(struct device *dev,
+ unsigned int nbits, gfp_t flags);
+
/*
* lib/bitmap.c provides these functions:
*/