diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-03-28 23:01:34 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-04-09 14:13:04 -0400 |
commit | aee0c612b12f57f4923f6649fa6fcba618182261 (patch) | |
tree | ebc6b4cde07d28735271a3bd6983a1e063c5569d /sound/core/info.c | |
parent | 4d8e8d21de89ff9d86b83182f723129533aacaa9 (diff) |
snd_info_register: switch to proc_create_data/proc_mkdir_mode
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'sound/core/info.c')
-rw-r--r-- | sound/core/info.c | 22 |
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) 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); |