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/block/pktcdvd.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/block/pktcdvd.c')
-rw-r--r-- | drivers/block/pktcdvd.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 0431e5977bcb..fd0472996df8 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -2744,7 +2744,6 @@ static int pkt_new_dev(struct pktcdvd_device *pd, dev_t dev) | |||
2744 | int i; | 2744 | int i; |
2745 | int ret = 0; | 2745 | int ret = 0; |
2746 | char b[BDEVNAME_SIZE]; | 2746 | char b[BDEVNAME_SIZE]; |
2747 | struct proc_dir_entry *proc; | ||
2748 | struct block_device *bdev; | 2747 | struct block_device *bdev; |
2749 | 2748 | ||
2750 | if (pd->pkt_dev == dev) { | 2749 | if (pd->pkt_dev == dev) { |
@@ -2788,11 +2787,7 @@ static int pkt_new_dev(struct pktcdvd_device *pd, dev_t dev) | |||
2788 | goto out_mem; | 2787 | goto out_mem; |
2789 | } | 2788 | } |
2790 | 2789 | ||
2791 | proc = create_proc_entry(pd->name, 0, pkt_proc); | 2790 | proc_create_data(pd->name, 0, pkt_proc, &pkt_proc_fops, pd); |
2792 | if (proc) { | ||
2793 | proc->data = pd; | ||
2794 | proc->proc_fops = &pkt_proc_fops; | ||
2795 | } | ||
2796 | DPRINTK(DRIVER_NAME": writer %s mapped to %s\n", pd->name, bdevname(bdev, b)); | 2791 | DPRINTK(DRIVER_NAME": writer %s mapped to %s\n", pd->name, bdevname(bdev, b)); |
2797 | return 0; | 2792 | return 0; |
2798 | 2793 | ||