@@ -149,23 +149,19 @@ static const struct attribute_group *soc_dev_attr_groups[] = {
#ifdef CONFIG_DEBUG_FS
static void soc_init_component_debugfs(struct snd_soc_component *component)
{
+ char name[64];
+
if (!component->card->debugfs_card_root)
return;
- if (component->debugfs_prefix) {
- char *name;
-
- name = kasprintf(GFP_KERNEL, "%s:%s",
+ if (component->debugfs_prefix)
+ snprintf(name, ARRAY_SIZE(name), "%s:%s",
component->debugfs_prefix, component->name);
- if (name) {
- component->debugfs_root = debugfs_create_dir(name,
- component->card->debugfs_card_root);
- kfree(name);
- }
- } else {
- component->debugfs_root = debugfs_create_dir(component->name,
- component->card->debugfs_card_root);
- }
+ else
+ snprintf(name, ARRAY_SIZE(name), "%s", component->name);
+
+ component->debugfs_root = debugfs_create_dir(name,
+ component->card->debugfs_card_root);
snd_soc_dapm_debugfs_init(snd_soc_component_get_dapm(component),
component->debugfs_root);