mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-24 15:42:32 +00:00
drivers: use non-racy method for proc entries creation
Use proc_create()/proc_create_data() to make sure that ->proc_fops and ->data be setup before gluing PDE to main tree. Signed-off-by: Denis V. Lunev <den@openvz.org> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Cc: Alexey Dobriyan <adobriyan@gmail.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Acked-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
0fd6894682
commit
1b50221738
5 changed files with 23 additions and 28 deletions
|
@ -1069,10 +1069,8 @@ no_irq:
|
|||
}
|
||||
|
||||
#ifdef CONFIG_PROC_FS
|
||||
ent = create_proc_entry("driver/rtc", 0, NULL);
|
||||
if (ent)
|
||||
ent->proc_fops = &rtc_proc_fops;
|
||||
else
|
||||
ent = proc_create("driver/rtc", 0, NULL, &rtc_proc_fops);
|
||||
if (!ent)
|
||||
printk(KERN_WARNING "rtc: Failed to register with procfs.\n");
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue