Skip to content

Commit

Permalink
snd_info_register: switch to proc_create_data/proc_mkdir_mode
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Apr 9, 2013
1 parent 4d8e8d2 commit aee0c61
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions sound/core/info.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit aee0c61

Please sign in to comment.