]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
sound: convert snd_info_register() to use proc_create_data()
authorNathan Zimmer <nzimmer@sgi.com>
Wed, 20 Mar 2013 04:06:51 +0000 (15:06 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 21 Mar 2013 05:27:12 +0000 (16:27 +1100)
Convert snd_info_register to use proc_create_data instead of
create_proc_entry.  This corrects a sparse warning introduced by "procfs:
Improve Scaling in proc" It is also a bit cleaner to let proc_create_data
set the ->data and ->proc_fops.

Signed-off-by: Nathan Zimmer <nzimmer@sgi.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
sound/core/info.c

index c9042b4d3695f32a97649dc9eaa0d84e569c5d68..dca0223f0b5586967825b6c662e9051021da6ba3 100644 (file)
@@ -949,20 +949,20 @@ EXPORT_SYMBOL(snd_info_free_entry);
 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);