int snd_info_register(struct snd_info_entry * entry)
{
struct proc_dir_entry *root, *p = NULL;
+ const struct file_operations *fops = NULL;
if (snd_BUG_ON(!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 (!S_ISDIR(entry->mode))
+ fops = &snd_info_entry_operations;
+ p = proc_create_data(entry->name, entry->mode, root, fops, entry);
if (!p) {
mutex_unlock(&info_mutex);
return -ENOMEM;
}
- 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);