diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2021-11-05 15:42:25 +0300 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2021-11-18 19:40:08 +0300 |
commit | acdb89b6c87a2d7b5c48a82756e6f5c6f599f60a (patch) | |
tree | 65bc8470331f571e3539593ce27ea5a2062e0291 /include/linux/string_helpers.h | |
parent | 418e0a3551bbef5b221705b0e5b8412cdc0afd39 (diff) | |
download | linux-acdb89b6c87a2d7b5c48a82756e6f5c6f599f60a.tar.xz |
lib/string_helpers: Introduce managed variant of kasprintf_strarray()
Some of the users want to have easy way to allocate array of strings
that will be automatically cleaned when associated device is gone.
Introduce managed variant of kasprintf_strarray() for such use cases.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'include/linux/string_helpers.h')
-rw-r--r-- | include/linux/string_helpers.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/string_helpers.h b/include/linux/string_helpers.h index f67a94013c87..7a22921c9db7 100644 --- a/include/linux/string_helpers.h +++ b/include/linux/string_helpers.h @@ -7,6 +7,7 @@ #include <linux/string.h> #include <linux/types.h> +struct device; struct file; struct task_struct; @@ -103,4 +104,6 @@ char *kstrdup_quotable_file(struct file *file, gfp_t gfp); char **kasprintf_strarray(gfp_t gfp, const char *prefix, size_t n); void kfree_strarray(char **array, size_t n); +char **devm_kasprintf_strarray(struct device *dev, const char *prefix, size_t n); + #endif |