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/misc | |
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/misc')
-rw-r--r-- | drivers/misc/hdpuftrs/hdpu_cpustate.c | 5 | ||||
-rw-r--r-- | drivers/misc/hdpuftrs/hdpu_nexus.c | 13 |
2 files changed, 5 insertions, 13 deletions
diff --git a/drivers/misc/hdpuftrs/hdpu_cpustate.c b/drivers/misc/hdpuftrs/hdpu_cpustate.c index 154155c9b638..ff51ab67231c 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) | |||
210 | return ret; | 210 | return ret; |
211 | } | 211 | } |
212 | 212 | ||
213 | proc_de = create_proc_entry("sky_cpustate", 0666, NULL); | 213 | proc_de = proc_create("sky_cpustate", 0666, NULL, &proc_cpustate); |
214 | if (!proc_de) { | 214 | if (!proc_de) { |
215 | printk(KERN_WARNING "sky_cpustate: " | 215 | printk(KERN_WARNING "sky_cpustate: " |
216 | "Unable to create proc entry\n"); | 216 | "Unable to create proc entry\n"); |
217 | } else { | ||
218 | proc_de->proc_fops = &proc_cpustate; | ||
219 | proc_de->owner = THIS_MODULE; | ||
220 | } | 217 | } |
221 | 218 | ||
222 | printk(KERN_INFO "Sky CPU State Driver v" SKY_CPUSTATE_VERSION "\n"); | 219 | 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 e92b7efccc72..08e26beefe64 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) | |||
102 | printk(KERN_ERR "sky_nexus: Could not map slot id\n"); | 102 | printk(KERN_ERR "sky_nexus: Could not map slot id\n"); |
103 | } | 103 | } |
104 | 104 | ||
105 | hdpu_slot_id = create_proc_entry("sky_slot_id", 0666, NULL); | 105 | hdpu_slot_id = proc_create("sky_slot_id", 0666, NULL, &proc_slot_id); |
106 | if (!hdpu_slot_id) | 106 | if (!hdpu_slot_id) { |
107 | printk(KERN_WARNING "sky_nexus: " | 107 | printk(KERN_WARNING "sky_nexus: " |
108 | "Unable to create proc dir entry: sky_slot_id\n"); | 108 | "Unable to create proc dir entry: sky_slot_id\n"); |
109 | } else { | ||
110 | hdpu_slot_id->proc_fops = &proc_slot_id; | ||
111 | hdpu_slot_id->owner = THIS_MODULE; | ||
112 | } | 109 | } |
113 | 110 | ||
114 | hdpu_chassis_id = create_proc_entry("sky_chassis_id", 0666, NULL); | 111 | hdpu_chassis_id = proc_create("sky_chassis_id", 0666, NULL, |
112 | &proc_chassis_id); | ||
115 | if (!hdpu_chassis_id) | 113 | if (!hdpu_chassis_id) |
116 | printk(KERN_WARNING "sky_nexus: " | 114 | printk(KERN_WARNING "sky_nexus: " |
117 | "Unable to create proc dir entry: sky_chassis_id\n"); | 115 | "Unable to create proc dir entry: sky_chassis_id\n"); |
118 | } else { | ||
119 | hdpu_chassis_id->proc_fops = &proc_chassis_id; | ||
120 | hdpu_chassis_id->owner = THIS_MODULE; | ||
121 | } | 116 | } |
122 | 117 | ||
123 | return 0; | 118 | return 0; |