aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/cpuid.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386/kernel/cpuid.c')
-rw-r--r--arch/i386/kernel/cpuid.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/arch/i386/kernel/cpuid.c b/arch/i386/kernel/cpuid.c
index 2e2756345bb2..4647db4ad6de 100644
--- a/arch/i386/kernel/cpuid.c
+++ b/arch/i386/kernel/cpuid.c
@@ -45,7 +45,7 @@
45#include <asm/uaccess.h> 45#include <asm/uaccess.h>
46#include <asm/system.h> 46#include <asm/system.h>
47 47
48static struct class_simple *cpuid_class; 48static struct class *cpuid_class;
49 49
50#ifdef CONFIG_SMP 50#ifdef CONFIG_SMP
51 51
@@ -158,12 +158,12 @@ static struct file_operations cpuid_fops = {
158 .open = cpuid_open, 158 .open = cpuid_open,
159}; 159};
160 160
161static int cpuid_class_simple_device_add(int i) 161static int cpuid_class_device_create(int i)
162{ 162{
163 int err = 0; 163 int err = 0;
164 struct class_device *class_err; 164 struct class_device *class_err;
165 165
166 class_err = class_simple_device_add(cpuid_class, MKDEV(CPUID_MAJOR, i), NULL, "cpu%d",i); 166 class_err = class_device_create(cpuid_class, MKDEV(CPUID_MAJOR, i), NULL, "cpu%d",i);
167 if (IS_ERR(class_err)) 167 if (IS_ERR(class_err))
168 err = PTR_ERR(class_err); 168 err = PTR_ERR(class_err);
169 return err; 169 return err;
@@ -175,10 +175,10 @@ static int __devinit cpuid_class_cpu_callback(struct notifier_block *nfb, unsign
175 175
176 switch (action) { 176 switch (action) {
177 case CPU_ONLINE: 177 case CPU_ONLINE:
178 cpuid_class_simple_device_add(cpu); 178 cpuid_class_device_create(cpu);
179 break; 179 break;
180 case CPU_DEAD: 180 case CPU_DEAD:
181 class_simple_device_remove(MKDEV(CPUID_MAJOR, cpu)); 181 class_device_destroy(cpuid_class, MKDEV(CPUID_MAJOR, cpu));
182 break; 182 break;
183 } 183 }
184 return NOTIFY_OK; 184 return NOTIFY_OK;
@@ -200,13 +200,13 @@ static int __init cpuid_init(void)
200 err = -EBUSY; 200 err = -EBUSY;
201 goto out; 201 goto out;
202 } 202 }
203 cpuid_class = class_simple_create(THIS_MODULE, "cpuid"); 203 cpuid_class = class_create(THIS_MODULE, "cpuid");
204 if (IS_ERR(cpuid_class)) { 204 if (IS_ERR(cpuid_class)) {
205 err = PTR_ERR(cpuid_class); 205 err = PTR_ERR(cpuid_class);
206 goto out_chrdev; 206 goto out_chrdev;
207 } 207 }
208 for_each_online_cpu(i) { 208 for_each_online_cpu(i) {
209 err = cpuid_class_simple_device_add(i); 209 err = cpuid_class_device_create(i);
210 if (err != 0) 210 if (err != 0)
211 goto out_class; 211 goto out_class;
212 } 212 }
@@ -218,9 +218,9 @@ static int __init cpuid_init(void)
218out_class: 218out_class:
219 i = 0; 219 i = 0;
220 for_each_online_cpu(i) { 220 for_each_online_cpu(i) {
221 class_simple_device_remove(MKDEV(CPUID_MAJOR, i)); 221 class_device_destroy(cpuid_class, MKDEV(CPUID_MAJOR, i));
222 } 222 }
223 class_simple_destroy(cpuid_class); 223 class_destroy(cpuid_class);
224out_chrdev: 224out_chrdev:
225 unregister_chrdev(CPUID_MAJOR, "cpu/cpuid"); 225 unregister_chrdev(CPUID_MAJOR, "cpu/cpuid");
226out: 226out:
@@ -232,8 +232,8 @@ static void __exit cpuid_exit(void)
232 int cpu = 0; 232 int cpu = 0;
233 233
234 for_each_online_cpu(cpu) 234 for_each_online_cpu(cpu)
235 class_simple_device_remove(MKDEV(CPUID_MAJOR, cpu)); 235 class_device_destroy(cpuid_class, MKDEV(CPUID_MAJOR, cpu));
236 class_simple_destroy(cpuid_class); 236 class_destroy(cpuid_class);
237 unregister_chrdev(CPUID_MAJOR, "cpu/cpuid"); 237 unregister_chrdev(CPUID_MAJOR, "cpu/cpuid");
238 unregister_cpu_notifier(&cpuid_class_cpu_notifier); 238 unregister_cpu_notifier(&cpuid_class_cpu_notifier);
239} 239}