diff options
author | Denis V. Lunev <den@openvz.org> | 2008-04-29 04:02:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 11:06:22 -0400 |
commit | c7705f3449c7edd5c1744871097f93977227afc4 (patch) | |
tree | d2f121a4b1ae3ae458db76ec0210ea2172c31e5a /drivers/ide/ide-proc.c | |
parent | 1b50221738108c438d5f25c7a043fb89e9e27044 (diff) |
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>
Diffstat (limited to 'drivers/ide/ide-proc.c')
-rw-r--r-- | drivers/ide/ide-proc.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c index 7b2f3815a838..8d6ad812a014 100644 --- a/drivers/ide/ide-proc.c +++ b/drivers/ide/ide-proc.c | |||
@@ -822,6 +822,7 @@ static int ide_drivers_open(struct inode *inode, struct file *file) | |||
822 | } | 822 | } |
823 | 823 | ||
824 | static const struct file_operations ide_drivers_operations = { | 824 | static const struct file_operations ide_drivers_operations = { |
825 | .owner = THIS_MODULE, | ||
825 | .open = ide_drivers_open, | 826 | .open = ide_drivers_open, |
826 | .read = seq_read, | 827 | .read = seq_read, |
827 | .llseek = seq_lseek, | 828 | .llseek = seq_lseek, |
@@ -830,16 +831,12 @@ static const struct file_operations ide_drivers_operations = { | |||
830 | 831 | ||
831 | void proc_ide_create(void) | 832 | void proc_ide_create(void) |
832 | { | 833 | { |
833 | struct proc_dir_entry *entry; | ||
834 | |||
835 | proc_ide_root = proc_mkdir("ide", NULL); | 834 | proc_ide_root = proc_mkdir("ide", NULL); |
836 | 835 | ||
837 | if (!proc_ide_root) | 836 | if (!proc_ide_root) |
838 | return; | 837 | return; |
839 | 838 | ||
840 | entry = create_proc_entry("drivers", 0, proc_ide_root); | 839 | proc_create("drivers", 0, proc_ide_root, &ide_drivers_operations); |
841 | if (entry) | ||
842 | entry->proc_fops = &ide_drivers_operations; | ||
843 | } | 840 | } |
844 | 841 | ||
845 | void proc_ide_destroy(void) | 842 | void proc_ide_destroy(void) |