diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-05-02 01:02:50 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-05-02 01:02:50 -0300 |
commit | d2f6bc6b2ac8f3da0943ea2761aa8d30bf4a00f5 (patch) | |
tree | cc867615221068e26e110c2c32d21f89f33b73f2 /linux/drivers/media/video/zoran_procfs.c | |
parent | a2f35a3ccf9953ece897da27cd27701c60bc296d (diff) | |
download | mediapointer-dvb-s2-d2f6bc6b2ac8f3da0943ea2761aa8d30bf4a00f5.tar.gz mediapointer-dvb-s2-d2f6bc6b2ac8f3da0943ea2761aa8d30bf4a00f5.tar.bz2 |
commit c7705f3449c7edd5c1744871097f93977227afc4
From: Mauro Carvalho Chehab <mchehab@infradead.org>
kernel-sync:
Author: Denis V. Lunev <den@openvz.org>
Date: Tue Apr 29 01:02:35 2008 -0700
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: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/zoran_procfs.c')
-rw-r--r-- | linux/drivers/media/video/zoran_procfs.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/linux/drivers/media/video/zoran_procfs.c b/linux/drivers/media/video/zoran_procfs.c index 5aa285bdc..d7bc097da 100644 --- a/linux/drivers/media/video/zoran_procfs.c +++ b/linux/drivers/media/video/zoran_procfs.c @@ -189,6 +189,7 @@ static ssize_t zoran_write(struct file *file, const char __user *buffer, } static const struct file_operations zoran_operations = { + .owner = THIS_MODULE, .open = zoran_open, .read = seq_read, .write = zoran_write, @@ -204,10 +205,8 @@ zoran_proc_init (struct zoran *zr) char name[8]; snprintf(name, 7, "zoran%d", zr->id); - if ((zr->zoran_proc = create_proc_entry(name, 0, NULL))) { - zr->zoran_proc->data = zr; - zr->zoran_proc->owner = THIS_MODULE; - zr->zoran_proc->proc_fops = &zoran_operations; + zr->zoran_proc = proc_create_data(name, 0, NULL, &zoran_operations, zr); + if (zr->zoran_proc != NULL) { dprintk(2, KERN_INFO "%s: procfs entry /proc/%s allocated. data=%p\n", |