aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/isapnp
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-04-29 04:02:35 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 11:06:22 -0400
commitc7705f3449c7edd5c1744871097f93977227afc4 (patch)
treed2f121a4b1ae3ae458db76ec0210ea2172c31e5a /drivers/pnp/isapnp
parent1b50221738108c438d5f25c7a043fb89e9e27044 (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/pnp/isapnp')
-rw-r--r--drivers/pnp/isapnp/proc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/pnp/isapnp/proc.c b/drivers/pnp/isapnp/proc.c
index e1d1f2a10947..3f94edab25fa 100644
--- a/drivers/pnp/isapnp/proc.c
+++ b/drivers/pnp/isapnp/proc.c
@@ -85,6 +85,7 @@ static ssize_t isapnp_proc_bus_read(struct file *file, char __user * buf,
85} 85}
86 86
87static const struct file_operations isapnp_proc_bus_file_operations = { 87static const struct file_operations isapnp_proc_bus_file_operations = {
88 .owner = THIS_MODULE,
88 .llseek = isapnp_proc_bus_lseek, 89 .llseek = isapnp_proc_bus_lseek,
89 .read = isapnp_proc_bus_read, 90 .read = isapnp_proc_bus_read,
90}; 91};
@@ -102,12 +103,10 @@ static int isapnp_proc_attach_device(struct pnp_dev *dev)
102 return -ENOMEM; 103 return -ENOMEM;
103 } 104 }
104 sprintf(name, "%02x", dev->number); 105 sprintf(name, "%02x", dev->number);
105 e = dev->procent = create_proc_entry(name, S_IFREG | S_IRUGO, de); 106 e = dev->procent = proc_create_data(name, S_IFREG | S_IRUGO, de,
107 &isapnp_proc_bus_file_operations, dev);
106 if (!e) 108 if (!e)
107 return -ENOMEM; 109 return -ENOMEM;
108 e->proc_fops = &isapnp_proc_bus_file_operations;
109 e->owner = THIS_MODULE;
110 e->data = dev;
111 e->size = 256; 110 e->size = 256;
112 return 0; 111 return 0;
113} 112}