From c7705f3449c7edd5c1744871097f93977227afc4 Mon Sep 17 00:00:00 2001 From: "Denis V. Lunev" Date: Tue, 29 Apr 2008 01:02:35 -0700 Subject: 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 Cc: Greg Kroah-Hartman Cc: Alexey Dobriyan Cc: "Eric W. Biederman" Cc: Peter Osterlund Cc: Bartlomiej Zolnierkiewicz Cc: Dmitry Torokhov Cc: Neil Brown Cc: Mauro Carvalho Chehab Cc: Bjorn Helgaas Cc: Alessandro Zummo Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/input/input.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'drivers/input/input.c') diff --git a/drivers/input/input.c b/drivers/input/input.c index 11426604d8a2..27006fc18305 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -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); -- cgit