summaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-04-29 01:02:35 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 08:06:22 -0700
commitc7705f3449c7edd5c1744871097f93977227afc4 (patch)
treed2f121a4b1ae3ae458db76ec0210ea2172c31e5a /drivers/misc
parent1b50221738108c438d5f25c7a043fb89e9e27044 (diff)
downloadop-kernel-dev-c7705f3449c7edd5c1744871097f93977227afc4.zip
op-kernel-dev-c7705f3449c7edd5c1744871097f93977227afc4.tar.gz
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/misc')
-rw-r--r--drivers/misc/hdpuftrs/hdpu_cpustate.c5
-rw-r--r--drivers/misc/hdpuftrs/hdpu_nexus.c13
2 files changed, 5 insertions, 13 deletions
diff --git a/drivers/misc/hdpuftrs/hdpu_cpustate.c b/drivers/misc/hdpuftrs/hdpu_cpustate.c
index 154155c..ff51ab6 100644
--- a/drivers/misc/hdpuftrs/hdpu_cpustate.c
+++ b/drivers/misc/hdpuftrs/hdpu_cpustate.c
@@ -210,13 +210,10 @@ static int hdpu_cpustate_probe(struct platform_device *pdev)
return ret;
}
- proc_de = create_proc_entry("sky_cpustate", 0666, NULL);
+ proc_de = proc_create("sky_cpustate", 0666, NULL, &proc_cpustate);
if (!proc_de) {
printk(KERN_WARNING "sky_cpustate: "
"Unable to create proc entry\n");
- } else {
- proc_de->proc_fops = &proc_cpustate;
- proc_de->owner = THIS_MODULE;
}
printk(KERN_INFO "Sky CPU State Driver v" SKY_CPUSTATE_VERSION "\n");
diff --git a/drivers/misc/hdpuftrs/hdpu_nexus.c b/drivers/misc/hdpuftrs/hdpu_nexus.c
index e92b7ef..08e26be 100644
--- a/drivers/misc/hdpuftrs/hdpu_nexus.c
+++ b/drivers/misc/hdpuftrs/hdpu_nexus.c
@@ -102,22 +102,17 @@ static int hdpu_nexus_probe(struct platform_device *pdev)
printk(KERN_ERR "sky_nexus: Could not map slot id\n");
}
- hdpu_slot_id = create_proc_entry("sky_slot_id", 0666, NULL);
- if (!hdpu_slot_id)
+ hdpu_slot_id = proc_create("sky_slot_id", 0666, NULL, &proc_slot_id);
+ if (!hdpu_slot_id) {
printk(KERN_WARNING "sky_nexus: "
"Unable to create proc dir entry: sky_slot_id\n");
- } else {
- hdpu_slot_id->proc_fops = &proc_slot_id;
- hdpu_slot_id->owner = THIS_MODULE;
}
- hdpu_chassis_id = create_proc_entry("sky_chassis_id", 0666, NULL);
+ hdpu_chassis_id = proc_create("sky_chassis_id", 0666, NULL,
+ &proc_chassis_id);
if (!hdpu_chassis_id)
printk(KERN_WARNING "sky_nexus: "
"Unable to create proc dir entry: sky_chassis_id\n");
- } else {
- hdpu_chassis_id->proc_fops = &proc_chassis_id;
- hdpu_chassis_id->owner = THIS_MODULE;
}
return 0;
OpenPOWER on IntegriCloud