mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 16:13:19 +09:00
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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user