diff options
Diffstat (limited to 'arch/i386/kernel/msr.c')
-rw-r--r-- | arch/i386/kernel/msr.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/arch/i386/kernel/msr.c b/arch/i386/kernel/msr.c index d535cdbbfd25..a773f776c9ea 100644 --- a/arch/i386/kernel/msr.c +++ b/arch/i386/kernel/msr.c | |||
@@ -239,14 +239,14 @@ static struct file_operations msr_fops = { | |||
239 | .open = msr_open, | 239 | .open = msr_open, |
240 | }; | 240 | }; |
241 | 241 | ||
242 | static int msr_class_device_create(int i) | 242 | static int msr_device_create(int i) |
243 | { | 243 | { |
244 | int err = 0; | 244 | int err = 0; |
245 | struct class_device *class_err; | 245 | struct device *dev; |
246 | 246 | ||
247 | class_err = class_device_create(msr_class, NULL, MKDEV(MSR_MAJOR, i), NULL, "msr%d",i); | 247 | dev = device_create(msr_class, NULL, MKDEV(MSR_MAJOR, i), "msr%d",i); |
248 | if (IS_ERR(class_err)) | 248 | if (IS_ERR(dev)) |
249 | err = PTR_ERR(class_err); | 249 | err = PTR_ERR(dev); |
250 | return err; | 250 | return err; |
251 | } | 251 | } |
252 | 252 | ||
@@ -258,10 +258,10 @@ static int msr_class_cpu_callback(struct notifier_block *nfb, | |||
258 | 258 | ||
259 | switch (action) { | 259 | switch (action) { |
260 | case CPU_ONLINE: | 260 | case CPU_ONLINE: |
261 | msr_class_device_create(cpu); | 261 | msr_device_create(cpu); |
262 | break; | 262 | break; |
263 | case CPU_DEAD: | 263 | case CPU_DEAD: |
264 | class_device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu)); | 264 | device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu)); |
265 | break; | 265 | break; |
266 | } | 266 | } |
267 | return NOTIFY_OK; | 267 | return NOTIFY_OK; |
@@ -290,7 +290,7 @@ static int __init msr_init(void) | |||
290 | goto out_chrdev; | 290 | goto out_chrdev; |
291 | } | 291 | } |
292 | for_each_online_cpu(i) { | 292 | for_each_online_cpu(i) { |
293 | err = msr_class_device_create(i); | 293 | err = msr_device_create(i); |
294 | if (err != 0) | 294 | if (err != 0) |
295 | goto out_class; | 295 | goto out_class; |
296 | } | 296 | } |
@@ -302,7 +302,7 @@ static int __init msr_init(void) | |||
302 | out_class: | 302 | out_class: |
303 | i = 0; | 303 | i = 0; |
304 | for_each_online_cpu(i) | 304 | for_each_online_cpu(i) |
305 | class_device_destroy(msr_class, MKDEV(MSR_MAJOR, i)); | 305 | device_destroy(msr_class, MKDEV(MSR_MAJOR, i)); |
306 | class_destroy(msr_class); | 306 | class_destroy(msr_class); |
307 | out_chrdev: | 307 | out_chrdev: |
308 | unregister_chrdev(MSR_MAJOR, "cpu/msr"); | 308 | unregister_chrdev(MSR_MAJOR, "cpu/msr"); |
@@ -314,7 +314,7 @@ static void __exit msr_exit(void) | |||
314 | { | 314 | { |
315 | int cpu = 0; | 315 | int cpu = 0; |
316 | for_each_online_cpu(cpu) | 316 | for_each_online_cpu(cpu) |
317 | class_device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu)); | 317 | device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu)); |
318 | class_destroy(msr_class); | 318 | class_destroy(msr_class); |
319 | unregister_chrdev(MSR_MAJOR, "cpu/msr"); | 319 | unregister_chrdev(MSR_MAJOR, "cpu/msr"); |
320 | unregister_hotcpu_notifier(&msr_class_cpu_notifier); | 320 | unregister_hotcpu_notifier(&msr_class_cpu_notifier); |