From d2f6bc6b2ac8f3da0943ea2761aa8d30bf4a00f5 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 2 May 2008 01:02:50 -0300 Subject: commit c7705f3449c7edd5c1744871097f93977227afc4 From: Mauro Carvalho Chehab kernel-sync: Author: Denis V. Lunev 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 --- linux/drivers/media/video/zoran_procfs.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'linux/drivers/media/video/zoran_procfs.c') 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", -- cgit v1.2.3