drivers: use non-racy method for proc entries creation (2)
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> Cc: Greg Kroah-Hartman <gregkh@suse.de> Cc: Alexey Dobriyan <adobriyan@gmail.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Peter Osterlund <petero2@telia.com> Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Cc: Dmitry Torokhov <dtor@mail.ru> Cc: Neil Brown <neilb@suse.de> Cc: Mauro Carvalho Chehab <mchehab@infradead.org> Cc: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
1b50221738
commit
c7705f3449
@ -904,20 +904,16 @@ static int __init input_proc_init(void)
|
||||
|
||||
proc_bus_input_dir->owner = THIS_MODULE;
|
||||
|
||||
entry = create_proc_entry("devices", 0, proc_bus_input_dir);
|
||||
entry = proc_create("devices", 0, proc_bus_input_dir,
|
||||
&input_devices_fileops);
|
||||
if (!entry)
|
||||
goto fail1;
|
||||
|
||||
entry->owner = THIS_MODULE;
|
||||
entry->proc_fops = &input_devices_fileops;
|
||||
|
||||
entry = create_proc_entry("handlers", 0, proc_bus_input_dir);
|
||||
entry = proc_create("handlers", 0, proc_bus_input_dir,
|
||||
&input_handlers_fileops);
|
||||
if (!entry)
|
||||
goto fail2;
|
||||
|
||||
entry->owner = THIS_MODULE;
|
||||
entry->proc_fops = &input_handlers_fileops;
|
||||
|
||||
return 0;
|
||||
|
||||
fail2: remove_proc_entry("devices", proc_bus_input_dir);
|
||||
|
Reference in New Issue
Block a user