diff options
author | Bartosz Golaszewski <bgolaszewski@baylibre.com> | 2021-03-15 12:13:56 +0300 |
---|---|---|
committer | Bartosz Golaszewski <bgolaszewski@baylibre.com> | 2021-05-05 17:07:39 +0300 |
commit | e829c2e4744850bab4d8f8ffebd00df10b4c6c2b (patch) | |
tree | d1c981da148f96f1147513ac8589bf6c6d86421d /include | |
parent | c13656b904b6173aad723d9680a81c60de2f5edc (diff) | |
download | linux-e829c2e4744850bab4d8f8ffebd00df10b4c6c2b.tar.xz |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/bitmap.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index 3282db97e06c..73d039476fa4 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 @@ 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: */ |