diff options
author | Denis V. Lunev <den@openvz.org> | 2008-04-29 04:02:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 11:06:22 -0400 |
commit | 1b50221738108c438d5f25c7a043fb89e9e27044 (patch) | |
tree | 510b2baf0675fee9ce450b6756ff36c77e2f626c /drivers/char/i8k.c | |
parent | 0fd689468231cb5eee9cc5d6331081b77c7a7a76 (diff) |
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>
Diffstat (limited to 'drivers/char/i8k.c')
-rw-r--r-- | drivers/char/i8k.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c index 8609b8236c67..f49037b744f9 100644 --- a/drivers/char/i8k.c +++ b/drivers/char/i8k.c | |||
@@ -82,6 +82,7 @@ static int i8k_ioctl(struct inode *, struct file *, unsigned int, | |||
82 | unsigned long); | 82 | unsigned long); |
83 | 83 | ||
84 | static const struct file_operations i8k_fops = { | 84 | static const struct file_operations i8k_fops = { |
85 | .owner = THIS_MODULE, | ||
85 | .open = i8k_open_fs, | 86 | .open = i8k_open_fs, |
86 | .read = seq_read, | 87 | .read = seq_read, |
87 | .llseek = seq_lseek, | 88 | .llseek = seq_lseek, |
@@ -554,13 +555,10 @@ static int __init i8k_init(void) | |||
554 | return -ENODEV; | 555 | return -ENODEV; |
555 | 556 | ||
556 | /* Register the proc entry */ | 557 | /* Register the proc entry */ |
557 | proc_i8k = create_proc_entry("i8k", 0, NULL); | 558 | proc_i8k = proc_create("i8k", 0, NULL, &i8k_fops); |
558 | if (!proc_i8k) | 559 | if (!proc_i8k) |
559 | return -ENOENT; | 560 | return -ENOENT; |
560 | 561 | ||
561 | proc_i8k->proc_fops = &i8k_fops; | ||
562 | proc_i8k->owner = THIS_MODULE; | ||
563 | |||
564 | printk(KERN_INFO | 562 | printk(KERN_INFO |
565 | "Dell laptop SMM driver v%s Massimo Dal Zotto (dz@debian.org)\n", | 563 | "Dell laptop SMM driver v%s Massimo Dal Zotto (dz@debian.org)\n", |
566 | I8K_VERSION); | 564 | I8K_VERSION); |