mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-17 22:23:45 -04:00
lib: bitmap: provide devm_bitmap_alloc() and devm_bitmap_zalloc()
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>
This commit is contained in:
@@ -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 @@ unsigned long *bitmap_alloc(unsigned int nbits, gfp_t flags);
|
||||
unsigned long *bitmap_zalloc(unsigned int nbits, gfp_t flags);
|
||||
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:
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user