snd_info_register: switch to proc_create_data/proc_mkdir_mode
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 29 Mar 2013 03:01:34 +0000 (23:01 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 9 Apr 2013 18:13:04 +0000 (14:13 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
sound/core/info.c

index 5bb97e7d325a21291f979e42d7f3dc668a3cff4d..a4e2de6874dfe61c773addfd647bbd77d72e5730 100644 (file)
@@ -959,15 +959,21 @@ int snd_info_register(struct snd_info_entry * entry)
                return -ENXIO;
        root = entry->parent == NULL ? snd_proc_root : entry->parent->p;
        mutex_lock(&info_mutex);
-       p = create_proc_entry(entry->name, entry->mode, root);
-       if (!p) {
-               mutex_unlock(&info_mutex);
-               return -ENOMEM;
+       if (S_ISDIR(entry->mode)) {
+               p = proc_mkdir_mode(entry->name, entry->mode, root);
+               if (!p) {
+                       mutex_unlock(&info_mutex);
+                       return -ENOMEM;
+               }
+       } else {
+               p = proc_create_data(entry->name, entry->mode, root,
+                                       &snd_info_entry_operations, entry);
+               if (!p) {
+                       mutex_unlock(&info_mutex);
+                       return -ENOMEM;
+               }
+               p->size = entry->size;
        }
-       if (!S_ISDIR(entry->mode))
-               p->proc_fops = &snd_info_entry_operations;
-       p->size = entry->size;
-       p->data = entry;
        entry->p = p;
        if (entry->parent)
                list_add_tail(&entry->list, &entry->parent->children);