aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/phantom.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/phantom.c')
-rw-r--r--drivers/misc/phantom.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/misc/phantom.c b/drivers/misc/phantom.c
index 04c27266f567..75ee0d3f6f45 100644
--- a/drivers/misc/phantom.c
+++ b/drivers/misc/phantom.c
@@ -21,6 +21,7 @@
21#include <linux/poll.h> 21#include <linux/poll.h>
22#include <linux/interrupt.h> 22#include <linux/interrupt.h>
23#include <linux/cdev.h> 23#include <linux/cdev.h>
24#include <linux/slab.h>
24#include <linux/phantom.h> 25#include <linux/phantom.h>
25#include <linux/sched.h> 26#include <linux/sched.h>
26#include <linux/smp_lock.h> 27#include <linux/smp_lock.h>
@@ -497,12 +498,7 @@ static struct pci_driver phantom_pci_driver = {
497 .resume = phantom_resume 498 .resume = phantom_resume
498}; 499};
499 500
500static ssize_t phantom_show_version(struct class *cls, char *buf) 501static CLASS_ATTR_STRING(version, 0444, PHANTOM_VERSION);
501{
502 return sprintf(buf, PHANTOM_VERSION "\n");
503}
504
505static CLASS_ATTR(version, 0444, phantom_show_version, NULL);
506 502
507static int __init phantom_init(void) 503static int __init phantom_init(void)
508{ 504{
@@ -515,7 +511,7 @@ static int __init phantom_init(void)
515 printk(KERN_ERR "phantom: can't register phantom class\n"); 511 printk(KERN_ERR "phantom: can't register phantom class\n");
516 goto err; 512 goto err;
517 } 513 }
518 retval = class_create_file(phantom_class, &class_attr_version); 514 retval = class_create_file(phantom_class, &class_attr_version.attr);
519 if (retval) { 515 if (retval) {
520 printk(KERN_ERR "phantom: can't create sysfs version file\n"); 516 printk(KERN_ERR "phantom: can't create sysfs version file\n");
521 goto err_class; 517 goto err_class;
@@ -541,7 +537,7 @@ static int __init phantom_init(void)
541err_unchr: 537err_unchr:
542 unregister_chrdev_region(dev, PHANTOM_MAX_MINORS); 538 unregister_chrdev_region(dev, PHANTOM_MAX_MINORS);
543err_attr: 539err_attr:
544 class_remove_file(phantom_class, &class_attr_version); 540 class_remove_file(phantom_class, &class_attr_version.attr);
545err_class: 541err_class:
546 class_destroy(phantom_class); 542 class_destroy(phantom_class);
547err: 543err:
@@ -554,7 +550,7 @@ static void __exit phantom_exit(void)
554 550
555 unregister_chrdev_region(MKDEV(phantom_major, 0), PHANTOM_MAX_MINORS); 551 unregister_chrdev_region(MKDEV(phantom_major, 0), PHANTOM_MAX_MINORS);
556 552
557 class_remove_file(phantom_class, &class_attr_version); 553 class_remove_file(phantom_class, &class_attr_version.attr);
558 class_destroy(phantom_class); 554 class_destroy(phantom_class);
559 555
560 pr_debug("phantom: module successfully removed\n"); 556 pr_debug("phantom: module successfully removed\n");