aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/info.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core/info.c')
-rw-r--r--sound/core/info.c31
1 files changed, 2 insertions, 29 deletions
diff --git a/sound/core/info.c b/sound/core/info.c
index 70fa87189f36..35df614f6c55 100644
--- a/sound/core/info.c
+++ b/sound/core/info.c
@@ -154,11 +154,6 @@ EXPORT_SYMBOL(snd_seq_root);
154struct snd_info_entry *snd_oss_root; 154struct snd_info_entry *snd_oss_root;
155#endif 155#endif
156 156
157static inline void snd_info_entry_prepare(struct proc_dir_entry *de)
158{
159 de->owner = THIS_MODULE;
160}
161
162static void snd_remove_proc_entry(struct proc_dir_entry *parent, 157static void snd_remove_proc_entry(struct proc_dir_entry *parent,
163 struct proc_dir_entry *de) 158 struct proc_dir_entry *de)
164{ 159{
@@ -522,32 +517,11 @@ static const struct file_operations snd_info_entry_operations =
522 .release = snd_info_entry_release, 517 .release = snd_info_entry_release,
523}; 518};
524 519
525/**
526 * snd_create_proc_entry - create a procfs entry
527 * @name: the name of the proc file
528 * @mode: the file permission bits, S_Ixxx
529 * @parent: the parent proc-directory entry
530 *
531 * Creates a new proc file entry with the given name and permission
532 * on the given directory.
533 *
534 * Returns the pointer of new instance or NULL on failure.
535 */
536static struct proc_dir_entry *snd_create_proc_entry(const char *name, mode_t mode,
537 struct proc_dir_entry *parent)
538{
539 struct proc_dir_entry *p;
540 p = create_proc_entry(name, mode, parent);
541 if (p)
542 snd_info_entry_prepare(p);
543 return p;
544}
545
546int __init snd_info_init(void) 520int __init snd_info_init(void)
547{ 521{
548 struct proc_dir_entry *p; 522 struct proc_dir_entry *p;
549 523
550 p = snd_create_proc_entry("asound", S_IFDIR | S_IRUGO | S_IXUGO, NULL); 524 p = create_proc_entry("asound", S_IFDIR | S_IRUGO | S_IXUGO, NULL);
551 if (p == NULL) 525 if (p == NULL)
552 return -ENOMEM; 526 return -ENOMEM;
553 snd_proc_root = p; 527 snd_proc_root = p;
@@ -974,12 +948,11 @@ int snd_info_register(struct snd_info_entry * entry)
974 return -ENXIO; 948 return -ENXIO;
975 root = entry->parent == NULL ? snd_proc_root : entry->parent->p; 949 root = entry->parent == NULL ? snd_proc_root : entry->parent->p;
976 mutex_lock(&info_mutex); 950 mutex_lock(&info_mutex);
977 p = snd_create_proc_entry(entry->name, entry->mode, root); 951 p = create_proc_entry(entry->name, entry->mode, root);
978 if (!p) { 952 if (!p) {
979 mutex_unlock(&info_mutex); 953 mutex_unlock(&info_mutex);
980 return -ENOMEM; 954 return -ENOMEM;
981 } 955 }
982 p->owner = entry->module;
983 if (!S_ISDIR(entry->mode)) 956 if (!S_ISDIR(entry->mode))
984 p->proc_fops = &snd_info_entry_operations; 957 p->proc_fops = &snd_info_entry_operations;
985 p->size = entry->size; 958 p->size = entry->size;