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/media/video | |
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/media/video')
-rw-r--r-- | drivers/media/video/zoran_procfs.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/media/video/zoran_procfs.c b/drivers/media/video/zoran_procfs.c index 328ed6e7ac6a..870bc5a70e3f 100644 --- a/drivers/media/video/zoran_procfs.c +++ b/drivers/media/video/zoran_procfs.c | |||
@@ -180,6 +180,7 @@ static ssize_t zoran_write(struct file *file, const char __user *buffer, | |||
180 | } | 180 | } |
181 | 181 | ||
182 | static const struct file_operations zoran_operations = { | 182 | static const struct file_operations zoran_operations = { |
183 | .owner = THIS_MODULE, | ||
183 | .open = zoran_open, | 184 | .open = zoran_open, |
184 | .read = seq_read, | 185 | .read = seq_read, |
185 | .write = zoran_write, | 186 | .write = zoran_write, |
@@ -195,10 +196,8 @@ zoran_proc_init (struct zoran *zr) | |||
195 | char name[8]; | 196 | char name[8]; |
196 | 197 | ||
197 | snprintf(name, 7, "zoran%d", zr->id); | 198 | snprintf(name, 7, "zoran%d", zr->id); |
198 | if ((zr->zoran_proc = create_proc_entry(name, 0, NULL))) { | 199 | zr->zoran_proc = proc_create_data(name, 0, NULL, &zoran_operations, zr); |
199 | zr->zoran_proc->data = zr; | 200 | if (zr->zoran_proc != NULL) { |
200 | zr->zoran_proc->owner = THIS_MODULE; | ||
201 | zr->zoran_proc->proc_fops = &zoran_operations; | ||
202 | dprintk(2, | 201 | dprintk(2, |
203 | KERN_INFO | 202 | KERN_INFO |
204 | "%s: procfs entry /proc/%s allocated. data=%p\n", | 203 | "%s: procfs entry /proc/%s allocated. data=%p\n", |