mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04: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:
parent
418e0a3551
commit
acdb89b6c8
2 changed files with 34 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue