aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/core/info.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/sound/core/info.c b/sound/core/info.c
index 5bb97e7d325a..a4e2de6874df 100644
--- a/sound/core/info.c
+++ b/sound/core/info.c
@@ -959,15 +959,21 @@ int snd_info_register(struct snd_info_entry * entry)
959 return -ENXIO; 959 return -ENXIO;
960 root = entry->parent == NULL ? snd_proc_root : entry->parent->p; 960 root = entry->parent == NULL ? snd_proc_root : entry->parent->p;
961 mutex_lock(&info_mutex); 961 mutex_lock(&info_mutex);
962 p = create_proc_entry(entry->name, entry->mode, root); 962 if (S_ISDIR(entry->mode)) {
963 if (!p) { 963 p = proc_mkdir_mode(entry->name, entry->mode, root);
964 mutex_unlock(&info_mutex); 964 if (!p) {
965 return -ENOMEM; 965 mutex_unlock(&info_mutex);
966 return -ENOMEM;
967 }
968 } else {
969 p = proc_create_data(entry->name, entry->mode, root,
970 &snd_info_entry_operations, entry);
971 if (!p) {
972 mutex_unlock(&info_mutex);
973 return -ENOMEM;
974 }
975 p->size = entry->size;
966 } 976 }
967 if (!S_ISDIR(entry->mode))
968 p->proc_fops = &snd_info_entry_operations;
969 p->size = entry->size;
970 p->data = entry;
971 entry->p = p; 977 entry->p = p;
972 if (entry->parent) 978 if (entry->parent)
973 list_add_tail(&entry->list, &entry->parent->children); 979 list_add_tail(&entry->list, &entry->parent->children);