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/toshiba.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/toshiba.c')
-rw-r--r-- | drivers/char/toshiba.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/char/toshiba.c b/drivers/char/toshiba.c index ce5ebe3b168f..64f1ceed0b2c 100644 --- a/drivers/char/toshiba.c +++ b/drivers/char/toshiba.c | |||
@@ -520,12 +520,11 @@ static int __init toshiba_init(void) | |||
520 | { | 520 | { |
521 | struct proc_dir_entry *pde; | 521 | struct proc_dir_entry *pde; |
522 | 522 | ||
523 | pde = create_proc_entry("toshiba", 0, NULL); | 523 | pde = proc_create("toshiba", 0, NULL, &proc_toshiba_fops); |
524 | if (!pde) { | 524 | if (!pde) { |
525 | misc_deregister(&tosh_device); | 525 | misc_deregister(&tosh_device); |
526 | return -ENOMEM; | 526 | return -ENOMEM; |
527 | } | 527 | } |
528 | pde->proc_fops = &proc_toshiba_fops; | ||
529 | } | 528 | } |
530 | #endif | 529 | #endif |
531 | 530 | ||