]> err.no Git - linux-2.6/commitdiff
sound: use non-racy method for /proc/driver/snd-page-alloc creation
authorDenis V. Lunev <den@openvz.org>
Tue, 29 Apr 2008 08:02:13 +0000 (01:02 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 29 Apr 2008 15:06:20 +0000 (08:06 -0700)
Use proc_create() to make sure that ->proc_fops be setup before gluing PDE to
main tree.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Jaroslav Kysela <perex@suse.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
sound/core/memalloc.c

index 920e5780c2284c9c086dd1bfaf02aff5462786d2..23b7bc02728b44ac9ad1086a827ffd3b917418ea 100644 (file)
@@ -629,9 +629,8 @@ static const struct file_operations snd_mem_proc_fops = {
 static int __init snd_mem_init(void)
 {
 #ifdef CONFIG_PROC_FS
-       snd_mem_proc = create_proc_entry(SND_MEM_PROC_FILE, 0644, NULL);
-       if (snd_mem_proc)
-               snd_mem_proc->proc_fops = &snd_mem_proc_fops;
+       snd_mem_proc = proc_create(SND_MEM_PROC_FILE, 0644, NULL,
+                                  &snd_mem_proc_fops);
 #endif
        return 0;
 }